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