The upgrade.php script provides PHP backwards compatibility. It does so by automatically defining workalikes for more recently introduced PHP 5.2 or 6.0 core functions when run in an older interpreter version (like 4.1). This allows developers or projects to safely use the more advanced features of PHP while still supporting most applications that run on outdated servers. It emulates over 100 core functions and the complete FTP, ctype, GETTEXT, and mime_magic extensions, and comes with reasonable emulations for PDO, bcmath, ODBC, and the FILTER extension.
| Tags | Software Development Libraries |
|---|---|
| Implementation | PHP |
Recent releases


Release Notes: Some 5.4 functions have been implemented, and possibly a few bugs fixed. While gzdecode existed before, hex2bin, session_status, zlib_encode, zlib_decode, http_redirect, http_response_code, get_declared_traits (stub), and safe_unserialize are new. Various flags for json_encode/_decode like JSON_HEX_AMP have been added, or the newly (5.4) introduced JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, and JSON_UNESCAPED_UNICODE. A not-yet/non-standard JSON_PARSE_JAVASCRIPT has been implemented, as well as a basic json_last_error() function. It's a largely untested development release, however.


Release Notes: Various new PHP 5.3 and 5.2 functions have been added. A new extension provides pspell functionality. Multiple errors have been fixed, such as example array handling in preg_filter and escaping in json_encode.


Release Notes: Contributed fixes to json_decode() helped with compliance of the array conversion parameter. New PHP5.3 additions are preg_filter(), lcfirst(), parse_ini_string(), and array_replace(). Contrib modules have been rearranged. A new style object-oriented $_REQUEST[] input wrapper and data filter have been added.


Release Notes: This release includes PDO emulation for PHP 4.x. This new unified PHP5 standard database interface prevents SQL injection exploits if you use its prepared statements instead of error-prone string concatenation and manual escaping. Other changes include more detailed phpDoc-style comments in the main script, and file_put_contents() support for the file locking flag. The emulated json_decode() function now supports Unicode escapes and still remains five times faster than JSON.php or the Zend_Framework decoder.


Release Notes: Compatibility code for PHP 5.1 and 5.2 has been added. The functions json_encode, json_decode, strptime, htmlspecialchars_decode, fputcsv, and a few others are available now.
Recent comments
24 Sep 2004 06:14
PEAR::PHP_Compat
There is an alternative to the "upgrade.php" script, that already existed for a longer time. You can find it under pear.php.net/package/P... (pear.php.net/package/P...) and it is sometimes already installed on servers.
The emulation functions of PHP_Compat (pear.php.net/package/P...) are often a bit cleaner and behave more (Warning messages) like the native ones would. It is suddenly also not complete yet, but both projects can be used in conjuction easily.