This commit is contained in:
Balhau 2025-01-08 21:59:04 +00:00
parent 88d595a7bf
commit fd2f7940ca

9
php/README.md Normal file
View file

@ -0,0 +1,9 @@
# What?
In this folder you got a set of examples integrating php code and native c code. The idea here is to explore a bit how we can call low level compiled c code in a higher language like PHP. Here we created the examples trying to target some questions related with performance and several ways to solve essencially the same problem.
This folder has a Makefile that can be used to simplify some of the command line needed to compile and run the programs.
If you take a look to the [Makefile](Makefile) you'll notice that **Docker** is being used here. This is to simplify the process of running php scripts on the command line with the [FFI](https://www.php.net/manual/en/book.ffi.php) enabled. This is needed because the FFI is the simplest way we have to enable a quick integration between low level c and higher level php code. In a more professional environment this would be done using [Zend Engine](https://en.wikipedia.org/wiki/Zend_Engine), fortunately this is not a professional environment so additional complexity is avoided.