PHP'S EMBEDED SAPI CAN PROVIDE MORE THAN just a means to synchronously load and execute script files. By understanding how the pieces of PHP's execution model fit together, it's possible to slide in and out of PHP's environment during a given request, and even give a script the power to call back into your host application. This chapter will cover the means to take advantage of the I/O hooks provided by the SAPI layer, and expand on the execution model you've already started to explore as part of previous topics.
The PHP Life Cycle
Variables from the Inside Out
Memory Management
Setting Up a Build Environment
Your First Extension
Returning Values
Accepting Parameters
Working with Arrays and HashTables
The Resource Data Type
PHP4 Objects
PHP5 Objects
Startup, Shutdown, and a Few Points in Between
INI Settings
Accessing Streams
Implementing Streams
Diverting the Stream
Configuration and Linking
Extension Generators
Setting Up a Host Environment
Advanced Embedding
Appendix A. A Zend API Reference
Appendix B. PHPAPI
Appendix C. Extending and Embedding Cookbook
Appendix D. Additional Resources