Released on 19 Dec 2000
Project description.
PHP is a popular general-purpose scripting language that is especially suited to web development
PHP 4.0.4 Changelog
  • Allow assigning a newly created object by reference. This is needed only if your constructor makes other data structures reference the $this object (for example, $GLOBALS["foobar"] =& $this;) The new syntax is $obj =& new MyClass(); (Andi, Zend Engine)
  • Allow for three expression types to be sent to functions which are requesting
      the function argument to be passed by reference (only c. was previously
      a. func(new myclass());
      b. func(func2()); where func2() returns a reference, i.e. is defined as
         function &func2(...)
      c. func($var); where func() is defined as function func(&$var) {...}
      You CAN'T count on any other expressions to be passable by reference.
      (Andi, Zend Engine)
  • Made ldap_get_entries() return an array even if there are no entries in search result. (Jani)
  • Fixed bad mod_perl interaction which caused segfaults when using LFS (Sascha)
  • const CONSTNAME now gets recognized. Before the patch only @const CONSTNAME description was recognized.
  • Added the is_null() function that will return true if a variable is of type null. (Sterling)
  • Fixed a bug which made readdir() unusable in some systems. (Jani)
  • Added the get_defined_functions() function which returns a list of all currently defined functions. (Sterling)
  • Added the get_defined_vars() function which returns an associative array of all variables defined in the current scope and their subsequent values. (Sterling)
  • Added the call_user_func_array() function which gives you the ability to call a user function by passing an array of parameters as the second argument. (Sterling)
  • Added the constant() function which returns the value of a constant given the constant's name. (Sterling)
  • Implemented support for Perl-style matching regexp delimiters in PCRE. You can use <{[( and )]}> to delimit your expressions now. (Andrei)
  • Introduced new 'F' modifier in PCRE that lets you specify a function name in the replacement argument to preg_replace() that will be called at run-time to provide the replacement string. It is passed an array of matched pattern and subpatterns. (Andrei)
  • Put an end to Bug #4615 (kalowsky & Eric Veldhuyzen)
  • Fixed realpath() in Virtual Directory mode (Daniel)
  • Integrated the Phil Nelson's bc math library routines into PHP, now that the license allows it (Phil Nelson)
  • Added the xslt_set_error_handler() function to the Sablotron extension. (Sterling)
  • Improved Sablotron's error handling system allowing you to catch all errors before they are outputted to the screen. (Sterling)
  • Added OpenSSL extension (Stig Venaas)
  • Fixed/created support for Solid 3.0 databases (kalowsky)
  • Fixed support for Solid 2.3 databases (kalowsky)
  • quoted_printable_decode() function is made RFC-2045 compliant. (Kir)
  • Modified preg_grep() to always return the results with keys from the original array. (Andrei)
  • Modified preg_replace() to accept Perl-style $n backreferences in addition to \\n ones. (Andrei)
  • Modified preg_replace() to ignore backreferences that refer to non-existing subpatterns. (Andrei)
  • Fixed column-title buffer-overflow in OCIFetchStatement(). (Thies)
  • Added 'output_handler' INI directive (Zeev)
  • Fixed some buglets in the output buffering mechanism (Zeev)
  • Added transparent gzip compression support (Jade Nicoletti, Zeev)
  • Major overhaul of domxml. Added basic XPath support as well (Uwe)
  • Added 'r' flag to date() which generates an RFC822 formatted date, e.g. "Thu, 9 Nov 2000 16:33:01 -0500" (Colin)
  • In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables as well (Zeev)
  • Allow user to use mysql_use_result in mysql queries (Stas)
  • Fixed a memory leak that would occur when restarting Apache often (
  • Fixed a bug that prevented $argv and $argc from being defined in the command line version of PHP (Stas)
  • Fixed a bug that prevented a changed compile-time extension_dir from affecting modules that were loaded via php.ini (Zeev)
  • Fixed a bug in ftp_mkdir() when used on ftp server which doesn't return the full path (Jani)
  • Added ImageCreateFromString() which creates an image stream out of e.g. a MySQL blob. (Mathieu)
  • Fixed a crash bug in imagewbmp() (Jani)
  • Changed the sablot configuration file so that if you use any version of Sablotron below 0.44 you must use Sablotron's built-in Expat libraries. (Sterling)
  • Added basic authentication support to thttpd (Sascha)
  • Added support for the Caudium webserver ( It's based on the Roxen SAPI module. Many bugs have been identified and fixed. (David)
  • Fixed mysql_close(), pg_close(), msql_close() and sybase_close() - they weren't properly closing the SQL connections (Zeev)
  • Fixed crypt() to supply random seed if none is given (Andi)
  • Made print_r() support recursive data structures, e.g. $GLOBALS. (Zeev)
  • Fixed a bug that caused PHP not to properly flush its output buffer, if more than one output buffer was used. (Zeev)
  • Fixed a bug that could draw the shutdown sequence of the PHP Apache module into an endless loop, under certain circumstances. It could cause Apache processes under Solaris to get stuck, especially when using output buffering. (Zeev)
  • Added support for serializing references (Stas)
  • Fixed conflict with OpenLDAP and Oracle 8.1.x (Jani)
  • parse_ini_file() supports a new optional 2nd argument that instructs it to divide the directives to arrays according to the sections in which they reside (Zeev)
  • parse_ini_file() is now thread-safe, and supported under Windows (Zeev)
  • Unified aborted-connection semantics of all SAPI modules (Sascha)
  • URL-opened files now store the HTTP response header in $http_response_header (Zeev)
  • Fixed array_rand() to shuffle results when the number of requested elements is the same as the number of elements in the array. (Andrei)
  • Added replace parameter to header() (Sascha)
  • Fixed handling of single quotes in transparent session-id mode (Sascha)
  • Fixed "php://*" fopen handler (Sascha)
  • Made rename work in threadsafe enviroments (Daniel)
  • Made session_destroy() close files before unlinking (Daniel)
  • Added array_sum() function. (Andrei)
  • Fixed a bug in session.c. The php_session_save_current_state did not check if mod_data is NULL and such situation is possible if the user calls session_module_name with a parameter. (
  • Added IIS Admin extension. (Frank)
  • OCIBindByName() now does better parameter-checking. (Thies)
  • Made read() binary-safe in sockets.c (Chris Vandomelen)
  • Made array_intersect() and array_diff() not alter order (Stig Venaas)
  • Made ldap_connect() accept URL in host parameter when using OpenLDAP 2.x. To use SSL, use ldaps://host/ as URL. (Stig Venaas)
  • Made resource type names visible, e.g. var_dump() and get_resource_type() display "file" for file resources. (Andrei)
  • Added the curl_getinfo() function to find out information about a CURL transfer. This function requires cURL 7.4.0 or above. (Sterling)
  • Renamed the shm_* functions to shmop_* (Derick)
  • Updated ext/mysql/libmysql to version 3.23 (
  • Added ldap_get_option() and ldap_set_option() functions (Stig Venaas)
  • Fixed a crash in CGI mode, in case no file was provided (Daniel Beulshausen& Zeev)
  • Fixed possible crash bug in imap_fetchstructure() (Jani)
  • Fixed possible crash bug in imap_open() (Jani & Mark Musone)
  • Added url_rewriter.tags configuration directive (Sascha)
  • Added CORBA client extension, ready for use (
  • Fixed memory leak in x-httpd-source mode (Jason Greene)
  • Changed ext/gd not to be enabled by default (Jani)
  • Make increment of empty string ("") behave like in PHP 3 and result in "1" (Andi, Zend Engine)
  • Added POST handler for Adobe FDF format (Hartmut)
  • Added transparent read and write .gz-files on glibc based systems using the 'zlib:' fopen wrapper (Hartmut)
  • Fixed a problem in the configuration parser (two null bytes were added to each ENCAPSULATED TC_STRING) (
  • Added HMAC support in the mhash module (
  • Added module for Ovrimos sql server (