Fixes #6465 Tests failures with PHP 5.6