Extending and Embedding PHP (Developer's Library) (英語) ペーパーバック – 2006/5/30
Kindle 端末は必要ありません。無料 Kindle アプリのいずれかをダウンロードすると、スマートフォン、タブレットPCで Kindle 本をお読みいただけます。
In just a few years PHP has rapidly evolved from a small niche language to a powerful web development tool. Now in use on over 14 million Web sites, PHP is more stable and extensible than ever. However, there is no documentation on how to extend PHP; developers seeking to build PHP extensions and increase the performance and functionality of their PHP applications are left to word of mouth and muddling through PHP internals without systematic, helpful guidance. Although the basics of extension writing are fairly easy to grasp, the more advanced features have a tougher learning curve that can be very difficult to overcome. This is common at any moderate to high-traffic site, forcing the company hire talented, and high-priced, developers to increase performance. With Extending and Embedding PHP, Sara Golemon makes writing extensions within the grasp of every PHP developer, while guiding the reader through the tricky internals of PHP.
Sara Golemon has been a core contributor to the PHP project since 2002, and is author of a dozen PECL extensions as well other other Open Source projects. She is actively involved in the planning and development of PHP6, and has written dozens of pages of the online manual including several whole reference sections and appendixes.
PHP Extention を書くために必要な詳細情報が（英語ですらほとんど）ない現在では、書籍としては最善と言えるかもしれません。
ただ如何せん、2006年に書かれた本なので、当然 PHP7 への言及はありません。本文で「XXの書き方は古いので今後はYYのように書きましょう」的なアドバイスがことごとく現在のターゲット (php-7.1.4) のコードの流儀に合っておらず、PHP のソースと見比べながら読んでいます。
私は Zend Engine 自体の理解がほとんどなかったので、Zend Engine の設計思想とか、体系的な知識の整理という意味では役立ちました。
PHP5 までの Extension を書いたことがある方にとっては、あまり役に立たないかもしれません。
The book assumes you are already somewhat familiar with PHP internals and basically "throws you in the deep end" right away. It is also aimed at C programmers (the language PHP is written in); if you only know PHP, you will probably have a hard time creating an extension using only the information contained in this book.
The book is also doesn't contain a lot of newer information, since it was written in 2006. Getting extensions to work with PHP 5.3 sometimes requires changes to old code that is not mentioned in this book.
Sara has a very in-deep knowledge of PHP extension development as well as PHP internals, and she knows how to guide the developer from the beginning, putting first in place "simple" tasks (like some traditional "hello world" function) up to more complex tasks such as PHP classes or streams implementations. The book even addresses the differences betwen PHP 4 et PHP 5 in separate chapters !
The book thoroughly covers every detail and I appreciated that the Windows developer that I mainly am was not forgotten in this learning process...
The reader is pacefully guided through the various steps of PHP extension development, with many ready-to-run examples and a really clear and never boring language style. Not only is this book one of the rare ones to address PHP extension development ; but it also couldn't have presented the subject more clearly.
I recommend this book to everyone involved into PHP development, even for people who do not intend to realize PHP extensions, because it also shows PHP internals that are of invaluable help to reach a deeper understanding of the PHP architecture.
Keep going on, Sara !
It is a very good source of information to understand PHP's internals, even if you don't plan to build PHP extensions.
A book that every good PHP developper interested in code performances should read.