---

Zend.com: Under The Hood of PHP 4

“By the time you read this article, PHP 4.0.0 is in final
release stages. Since PHP 4 is by far the most advanced version
of PHP, I wanted to share with you an inner look at what makes this
open source freeware tick.
Many of the most important features
of PHP 4, such as the replacement of the scripting engine and
modularization, are transparent to end users. Nonetheless, these
are exactly the features that make the difference between a stable,
efficient and reliable Web scripting solution, and a less stable
solution….”

“If PHP 3 was so great and popular, what in the world made us
write it from scratch, all over, again? In simple terms, we weren’t
being creative enough. While we did switch to a much reliable
approach in our parser (which analyzed the entire script, instead
of line-by-line), we didn’t question the very nature of PHP, which
was: “execute the code while reading it.”

“PHP, throughout all of its versions, always “understood”
(parsed) and executed the code simultaneously. This was one of the
main reasons PHP was so quick with short, simple scripts; there was
minimal startup time and it included simple data structures
necessary for the implementation. On the other hand, this meant
that PHP became less and less efficient as scripts began to be more
and more complex, due to the need to repeatedly parse the same
parts of the file in many cases, such as loops or repetitive
function calls.”

Complete
Story