Chapter 46. Zend API: Hacking the Core of PHP

Table of Contents
Introduction
Overview
Extension Possibilities
Source Layout
PHP's Automatic Build System
Creating Extensions
Using Extensions
Troubleshooting
Source Discussion
Accepting Arguments
Creating Variables
Duplicating Variable Contents: The Copy Constructor
Returning Values
Printing Information
Startup and Shutdown Functions
Calling User Functions
Initialization File Support
Where to Go from Here
Reference: Some Configuration Macros
API Macros
API Function and Macro reference (work in progress)

Introduction

Those who know don't talk.

Those who talk don't know.

Sometimes, PHP "as is" simply isn't enough. Although these cases are rare for the average user, professional applications will soon lead PHP to the edge of its capabilities, in terms of either speed or functionality. New functionality cannot always be implemented natively due to language restrictions and inconveniences that arise when having to carry around a huge library of default code appended to every single script, so another method needs to be found for overcoming these eventual lacks in PHP.

As soon as this point is reached, it's time to touch the heart of PHP and take a look at its core, the C code that makes PHP go.

Warning

This information is currently rather outdated, parts of it only cover early stages of the ZendEngine 1.0 API as it was used in early versions of PHP 4.

More recent information may be found in the various README files that come with the PHP source and the Internals section on the Zend website.