On Sep 6, 2023, at 19:18, Hanz <zaun...@gmail.com> wrote: > On a totally different note... I'm trying to get my head around FFI > <https://www.php.net/manual/en/book.ffi.php> specifically how it could be > used to orchestrate 3rd party pipelines, like those of python.
That isn't a particularly good use case for FFI. If you're trying to call Python scripts, you're probably looking for popen(), proc_open(), or something like the Symfony Process component (composer require symfony/process). FFI allows PHP scripts to load and call functions in C libraries. This can allow PHP scripts to access functionality which doesn't have PHP wrappers available. If you're on macOS, here's a silly but functional example which calls the NSBeep() function to make your computer beep: $ffi = FFI::cdef(<<<'EOF' void NSBeep(void); EOF, "@rpath/AppKit.framework/AppKit"); $ffi->NSBeep(); sleep(1); (Don't worry too much about the @rpath bit.) -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php