3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (array( 'path_without_slash', 'path/to/file/', 'path/to/file', ) as $somestring) { var_dump(substr($somestring, strrpos("/$somestring", '/'))); }

preferences:
84.39 ms | 406 KiB | 5 Q