Work-around for https://bugs.php.net/bug.php?id=39598

Fixes #3922
3 files changed