3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dir_root = '/coucou/test/install/../'; $dir = '/coucou/test/install/../images/logo/0'; if (strpos($dir, $dir_root) === 0) { $dir = './' . substr($dir, strlen(DIR_ROOT) + 1); echo $dir; }
based on 5JJBJ
Output for 7.2.0
Warning: Use of undefined constant DIR_ROOT - assumed 'DIR_ROOT' (this will throw an Error in a future version of PHP) in /in/jk017 on line 6 ./est/install/../images/logo/0
Output for 5.3.22 - 7.1.10
Notice: Use of undefined constant DIR_ROOT - assumed 'DIR_ROOT' in /in/jk017 on line 6 ./est/install/../images/logo/0