3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $f = new SplFileObject('php://memory', 'w+'); $f->fwrite("A\nB"); var_dump($f->current(), (string) $f);
Output for 5.3.22 - 5.3.29, 5.4.7 - 7.1.0
string(0) "" string(0) ""
Output for 5.1.4 - 5.3.21, 5.4.0 - 5.4.6
string(0) "" string(12) "php://memory"
Output for 5.1.0 - 5.1.3
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(php://memory): failed to open stream: Inappropriate ioctl for device' in /in/ipZ4i:3 Stack trace: #0 /in/ipZ4i(3): SplFileObject->__construct('php://memory', 'w+') #1 {main} thrown in /in/ipZ4i on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplFileObject' not found in /in/ipZ4i 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/ipZ4i 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/ipZ4i on line 3