3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $c = new SplObjectStorage (); // You store some data using some string keys foreach (array('ab', 'cd', '10', 'gh', '24') as $key) { $c[(object)$key] = 1; } // You pass the array $c to some place else and there you do something like foreach ($c as $k => $v) { if ($k === "10") { echo "found"; exit; } }
based on R17Gj
Output for 5.3.0 - 7.2.0
Output for 5.1.0 - 5.2.17
Fatal error: Cannot use object of type SplObjectStorage as array in /in/YQguT on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'SplObjectStorage' not found in /in/YQguT 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/YQguT 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/YQguT on line 3