PHP 4
In late
1998, Zeev and Andi looked back at their work in PHP 3 and felt they could have
written the scripting language even better, so they started yet another
rewrite. While PHP 3 still continuously parsed the scripts while executing
them, PHP 4 came with a new paradigm of "compile first, execute
later." The compilation step does not compile PHP scripts into machine
code; it instead compiles them into byte code, which is then executed by the Zend Engine (Zend stands for Zeev & Andi), the
new heart of PHP 4. Because of this new way of executing scripts, the
performance of PHP 4 was much better than that of PHP 3, with only a small
amount of backward compatibility breakage.
Among
other improvements was an improved extension API for better run-time
performance, a web server abstraction layer allowing PHP 4 to run on most
popular web servers, and lots more. PHP 4 was officially released on May 22,
2002, and today its installed base has surpassed 15 million domains. In PHP 3,
the minor version number (the middle digit) was never used, and all versions
were numbered as 3.0.x. This changed in PHP 4, and the minor version number was
used to denote important changes in the language. The first important change
came in PHP 4.1.0, which introduced superglobals such as $_GET and $_POST .
Superglobals
can be accessed from within functions without having to use the global
keyword. This feature was added in order to allow the register_globals INI
option to be turned off. register_globals is a feature in PHP which
automatically converts input variables like "?foo=bar" in http://php.net/?foo=barto a PHP
variable called $foo. Because many people do not check input variables
properly, many applications had security holes, which made it quite easy to
circumvent security and authentication code.
With the
new superglobals in place, on April 22, 2002, PHP 4.2.0 was released with the
register_globals turned off by default. PHP 4.3.0, the last significant PHP 4
version, was released on December 27, 2002. This version introduced the Command Line Interface (CLI), a revamped file and network
I/O layer (called streams),
and a bundled GD library. Although most of those additions have no real effect
on end users, the major version was bumped due to the major changes in PHP’s
core.
No comments:
Post a Comment