3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $f = new SplFileObject('php://memory', 'rw'); $f->fwrite("A\nB"); var_dump($f->current(), (string) $f);
Output for 5.3.22 - 5.3.29, 5.4.7 - 5.6.28, 7.0.0 - 7.1.0
string(0) "" string(0) ""
Output for hhvm-3.10.0 - 3.12.0
bool(false) string(12) "php://memory"
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/30v8r:3 Stack trace: #0 /in/30v8r(3): SplFileObject->__construct('php://memory', 'rw') #1 {main} thrown in /in/30v8r on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplFileObject' not found in /in/30v8r 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/30v8r 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/30v8r on line 3