added workaround to https://bugs.php.net/bug.php?id=49184
added workaround to https://bugs.php.net/bug.php?id=49184