Working with PHP Callbacks
Learn how to implement callbacks in PHP 8 applications.
We'll cover the following...
It’s possible to use the FFI extension to incorporate shared C libraries that are part of the actual PHP language (or its extensions). This integration is important as it allows you to read and write native PHP data in your C library by accessing the C data structures defined in the PHP-shared C libraries.
We introduce you to the FFI extension’s ability to override native PHP language functionality. This ability is referred to as a PHP callback. Before we get into the implementation details, we must first examine the potential dangers associated with this ability.