Hardened workaround for PHP bug 47206, closes #1092