PHP 5.2.x compatibility fix