Приглашаем посетить
Есенин (esenin-lit.ru)

Chapter 20.  PHP and Zend Engine Internals

Previous
Table of Contents
Next

20. PHP and Zend Engine Internals

LIKE MOST AMERICANS, I DRIVE A CAR to work. I know the basic capabilities of my vehicle. I know how fast it can go, how quickly it can brake, what speeds feel safe to make a turn. I also know about the basic maintenance of my car. I know I need to change my oil every 3,000 miles and to check my tire pressure regularly. In a pinch, I can even change my own oil, although I prefer to let someone else deal with the mess.

I remember enough from physics class that I could tell you how an internal combustion engine works in general, but I'm certain I know nothing about how a turbocharger works or what a "dual overhead cam" really means for my car's maintainability and performance. It's okay that I don't know these things because I am a casual user of the automobile. I use it to get from Point A to Point B. My car is not a racecar and I am not a racecar driver. In contrast, most racecar drivers know a lot about how their cars work. Even if they have a team of specialists whose job is to maintain intricate systems, the drivers use their knowledge to push the vehicle to the limits of its performance and to make sound field assessments of how the car is running and when it needs to be tuned.

My car is not a racecar, but the Web sites I work on are. They are high-traffic sites where even minor performance differences can have serious financial impacts. I'm not just a casual user, so I cannot afford to have only a casual knowledge of how PHP works. Understanding how PHP is implemented is not necessary to being a good PHP programmer, but it can help you do a few things:

  • Make sound architectural choices by understanding PHP's strengths and weaknesses

  • Quickly locate and address bugs in PHP itself

  • Understand where and how to add extensions

  • Understand how various parts of the engine perform

This chapter is a hands-off overview of how PHP and the Zend Engine work. You won't actually be implementing any extensionsyou'll do that in the next two chaptersbut the next chapters will assume a working knowledge of the material covered here. Knowledge of C is not necessary to understand this chapter, although it would certainly help; a large amount of internal engine code in C is excerpted.


Previous
Table of Contents
Next