Using missing PHP5 functions in PHP4
April 28th, 2007 · Filed under ArchivesWith PHP5 a number of new functions were added. Understandably, these functions won’t work if your web server runs PHP4. But there’s a workaround.
PHP_Compat is a package of files with the missing functionality for older PHP version. Each file provides support for one function, and is usually named after the function.
How do you use it?
- Download the package.
- Find the file you need. Each function is in its own file, e.g. array_walk_recursive.php.
- Place this file somewhere in your include_path.
- Include it, e.g. <?php require_once ‘array_walk_recursive.php’;?>
The function is now ready to be used.
Note: Don’t let the PEAR website scare you. PHP_Compat can be used without installing PEAR.
Trackback URL for this post:
http://rehuel.com/2007/04/28/using-missing-php5-functions-in-php4/trackback/




