3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $info = new SplFileInfo('/path/to'); var_dump($info->getBasename());
Output for 5.2.2 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(2) "to"
Output for 5.1.2 - 5.2.1
<br /> <b>Fatal error</b>: Call to undefined method SplFileInfo::getBasename() in <b>/in/K9PcV</b> on line <b>3</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.1.1
<br /> <b>Fatal error</b>: Class 'SplFileInfo' not found in <b>/in/K9PcV</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: splfileinfo in <b>/in/K9PcV</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: splfileinfo in <b>/in/K9PcV</b> on line <b>2</b><br />