3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dirname2($path) { $i = strrpos($path,'/'); return $i; } echo(dirname2('/a/b/c/d'));

preferences:
46.38 ms | 402 KiB | 5 Q