Fixes #54143

https://bugs.php.net/bug.php?id=54143