3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $File = new SplFileObject(__FILE__); echo (string) $File, '<br />'; foreach ($File as $line) { echo $line, '<br />'; }
Output for 5.3.22 - 5.3.29, 5.4.7 - 7.2.0
<?php <br /><?php <br /> <br />$File = new SplFileObject(__FILE__); <br /> <br />echo (string) $File, '<br />'; <br />foreach ($File as $line) <br />{ <br /> echo $line, '<br />'; <br />}<br />
Output for 5.1.2 - 5.3.21, 5.4.0 - 5.4.6
/in/DAdRX<br /><?php <br /> <br />$File = new SplFileObject(__FILE__); <br /> <br />echo (string) $File, '<br />'; <br />foreach ($File as $line) <br />{ <br /> echo $line, '<br />'; <br />}<br />
Output for 5.1.1
�p<br /><?php <br /> <br />$File = new SplFileObject(__FILE__); <br /> <br />echo (string) $File, '<br />'; <br />foreach ($File as $line) <br />{ <br /> echo $line, '<br />'; <br />}<br />
Output for 5.1.0
ȟK<br /><?php <br /> <br />$File = new SplFileObject(__FILE__); <br /> <br />echo (string) $File, '<br />'; <br />foreach ($File as $line) <br />{ <br /> echo $line, '<br />'; <br />}<br />
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplFileObject' not found in /in/DAdRX on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splfileobject in /in/DAdRX on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splfileobject in /in/DAdRX on line 3