Fix compat with PHP 5.4 (#8365)
Even if we do not support it, the fix is trivial and does not make the code worse.