We’re using PHP version 4.x in production at work, and I often find myself needing a function that has been implemented in PHP 5. A good example is the array_walk_recursive() function. I needed this in my framework library to recursively walk through an input array with a callback function to strip values of potentially harmful input. The recursive ability was key because the input array could be arbitrarily large, containing several nested arrays.
Now, I could have implemented my own function to do just this, but when we do move to PHP 5 in production, I’d want to recode to use the standard library function. To the rescue comes the PHP_Compat PEAR package, full of functions and constants to help bridge the gap between different PHP versions.
Thanks to Aidan Lister (the lead developer) and others who contributed to this package. It has saved me much coding, and I’m grateful!

