3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function path_relative_to($path, $rel) { $rel_lent = strlen($rel); if (strncmp($path, $ref, strlen($rel)) == 0) { return substr($path, strlen($rel)); } else { return ""; } } var_dump(path_relative_to("a/b/c", "a"));
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: ref in /in/KG2lZ on line 6 string(0) ""
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: ref in /in/KG2lZ on line 6 string(0) ""