Added workaround for PHP bug 47206, closes #1038