Fix problem with php < 5.3.4 https://bugs.php.net/bug.php?id=52854