Using FFI in an Application
Learn how FFI methods help developers execute C-language code in a PHP application.
We'll cover the following...
Any shared C library (generally with a *. so
extension) can be included in a PHP application using the FFI extension. If we plan to work with any of the core PHP libraries or libraries produced when PHP extensions are installed, it’s important to note that we have the ability to modify the behavior of the PHP language itself.
Before we examine how that works, let’s first have a look at incorporating an external C library into a PHP script using the FFI extension.
Integrating an external C library into a PHP script
For ...