3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // As an object set $s = new SplObjectStorage(); $o1 = new StdClass; $o2 = new StdClass; $o3 = new StdClass; $s->attach($o1); $s->attach($o2); var_dump($s->contains($o1)); var_dump($s->contains($o2)); var_dump($s->contains($o3)); $s->detach($o2); var_dump($s->contains($o1)); var_dump($s->contains($o2)); var_dump($s->contains($o3)); ?>
Output for 5.1.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
bool(true) bool(true) bool(false) bool(true) bool(false) bool(false)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplObjectStorage' not found in /in/AQcks on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splobjectstorage in /in/AQcks on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splobjectstorage in /in/AQcks on line 3