Made PHP library compatible for PHP 5.2