mitigate issues caused by https://bugs.php.net/bug.php?id=47357

Suggested fix for https://github.com/mako-framework/framework/issues/56