Posts Tagged ‘Step by step’

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…)

How to create PHP extensions – part I: simple functions

Thursday, July 7th, 2011

There are some situations when every developer encounters limitations in PHP. For some, the problem is performance, for others the lack of specific, low-level functionality.

In that cases, the only solution is to write your own PHP extension that adds the missing features to the language.

Unfortunately, although the documentation of the PHP language itself is excellent, the information on the programming of the PHP engine are rudimentary.

In this series of articles I will try to show you, how to write the PHP extensions and describe some of the Zend engine features. (more…)

How to compile PHP scripts?

Wednesday, July 6th, 2011

In an earlier article I described how to install HipHop for PHP translator that allows compilation of the PHP scripts.

This time, I will describe different types of compilations, so that it is possible to build both simple scripts and large systems written in PHP. (more…)