3v4l.org

run code in 300+ PHP versions simultaneously
<?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; }

preferences:
62.78 ms | 405 KiB | 5 Q