3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data_provider = array( array(), true, "string", 12345, 1.2345, NULL ); foreach($data_provider as $input) { $s = new SplObjectStorage(); var_dump($s->removeAllExcept($input)); } ?>
based on XunVA
Output for 7.0.0 - 7.1.0
Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, array given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, boolean given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, string given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, integer given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, float given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, null given in /in/00OI4 on line 16 NULL
Output for 5.3.6 - 5.6.28
Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, array given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, boolean given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, string given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, integer given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, double given in /in/00OI4 on line 16 NULL Warning: SplObjectStorage::removeAllExcept() expects parameter 1 to be SplObjectStorage, null given in /in/00OI4 on line 16 NULL
Output for 5.1.0 - 5.3.5
Fatal error: Call to undefined method SplObjectStorage::removeAllExcept() in /in/00OI4 on line 16
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplObjectStorage' not found in /in/00OI4 on line 14
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splobjectstorage in /in/00OI4 on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splobjectstorage in /in/00OI4 on line 14