Workaround for https://bugs.php.net/bug.php?id=52854