fixed #853 for good (i.e. for PHP 5.2.6 and higher)