3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $name = 'CFE 2012 DECL INITIAL.pdf'; $extension = 'pdf'; if (substr($name, -strlen($extension)) == $extension) { $name = str_replace('.'.$extension, '', $name); } var_dump($name);
Output for 4.3.0 - 7.2.0
string(21) "CFE 2012 DECL INITIAL"