3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $source = str_replace('\\', DIRECTORY_SEPARATOR, realpath($source)) . '<br>'; $docRoot = str_replace('/', '\\', $_SERVER['DOCUMENT_ROOT']). '<br>'; // normalize to http $diff = str_replace($docRoot, '', $source). '<br>'; echo $source; echo $docRoot; echo $diff; ?>
based on BRcO5
Output for 5.2.3 - 7.1.0
Notice: Undefined variable: source in /in/IhM53 on line 2 /<br><br>/<br>
Output for 5.2.1 - 5.2.2
Notice: Undefined variable: source in /in/IhM53 on line 2 Notice: Undefined index: DOCUMENT_ROOT in /in/IhM53 on line 3 /in<br><br>/in<br>
Output for 5.0.4 - 5.2.0
Notice: Undefined variable: source in /in/IhM53 on line 2 Notice: Undefined index: DOCUMENT_ROOT in /in/IhM53 on line 3 <br><br><br>
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: source in /in/IhM53 on line 2 Notice: Undefined index: DOCUMENT_ROOT in /in/IhM53 on line 3 <br><br><br>