3v4l.org

run code in 300+ PHP versions simultaneously
<?php private function extension($str){ $str=implode("",explode("\\",$str)); $str=explode(".",$str); $str=strtolower(end($str)); return $str; } // EXAMPLE: $file='name-Of_soMe.File.txt'; echo extension($file); // txt ?>
Output for 5.4.0 - 5.4.28, 5.5.0 - 5.5.12
Parse error: syntax error, unexpected 'private' (T_PRIVATE) in /in/O0b1F on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PRIVATE in /in/O0b1F on line 2
Process exited with code 255.

preferences:
191.16 ms | 1395 KiB | 78 Q