PHP: Fix logic/paths compatibility with versions > 5.3