retrofitted to work with PHP 5.3 [#2146]