Backport new classes and functions into PHP 5.1.3