3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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.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.