3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reverse = TRUE; $str = 'test/ezifh'; $f = $reverse ? 'strrpos' : 'strpos'; if (($pos = $f($str, $separator)) !== FALSE) { $str = substr($str, $pos + 1); } var_dump($str);

preferences:
43.91 ms | 402 KiB | 5 Q