From day one, PHP's main purpose has been to act as glue between an easy to use scripting language and more complex functionality found in established compiled libraries. Creating new bindings to glue in custom functionality has always been a complex operation requiring a special union of knowledge between C, PHP, and the somewhat inscrutable Zend API. While that's still the best route, PHP 7.4 does bring in a new option to make simple bindings much easier to produce; It's called FFI, or Foreign Function Interface. This session will explore using FFI to create stable, functional "extensions" with far less pointer juggling and everything about the Zend API abstracted away.

Comments

Comments are closed.

Great talk. A simpler example of a library to wrap, like the Hydra one you mentioned later in the talk, would probably be a good one to lead with. I'd still include the libgmp example as a case of a library that's more challenging to pull in via FFI, though. Adding a more explicit short refresher early in the slide deck on C/C++ concepts used in the examples might help those of us with lacking or rusty experience with C/C++.