Archive for August, 2011

How to create PHP extensions – part II: Introduction to PHP variables

Thursday, August 4th, 2011

In one of my previous articles I explained how to build a PHP extension, and how to declare a simple function in C. I demonstrated how to return data from the C function to the script in PHP. But I have not explained how to pass the arguments to the function, nor how to change the values of existing PHP variables.

In order to do so, I have to introduce you the internal ZVAL data structure used by PHP engine to store the PHP variables. (more…)