3v4l.org

run code in 300+ PHP versions simultaneously
<?php function path_relative_to($path, $rel) { $rel_lent = strlen($rel); if (strncmp($path, $rel, strlen($rel)) == 0) { return substr($path, strlen($rel)); } else { return ""; } } var_dump(basename("/");
Output for 5.3.0 - 5.3.21, 5.4.0 - 5.4.11
Parse error: syntax error, unexpected ';' in /in/a7naZ on line 16
Process exited with code 255.

preferences:
172.76 ms | 1395 KiB | 41 Q