3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $file = new SplFileObject(tmpfile());
based on 6G8rd
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: SplFileObject::__construct() expects parameter 1 to be a valid path, resource given in /in/MrotJ:3 Stack trace: #0 /in/MrotJ(3): SplFileObject->__construct(Resource id #4) #1 {main} thrown in /in/MrotJ on line 3
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct() expects parameter 1 to be a valid path, resource given' in /in/MrotJ:3 Stack trace: #0 /in/MrotJ(3): SplFileObject->__construct(Resource id #4) #1 {main} thrown in /in/MrotJ on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct() expects parameter 1 to be string, resource given' in /in/MrotJ:3 Stack trace: #0 /in/MrotJ(3): SplFileObject->__construct(Resource id #4) #1 {main} thrown in /in/MrotJ on line 3
Process exited with code 255.