3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $stack = new SplStack(); $stack->push(13); $stack->push(17); $stack->push(19); foreach($stack as $item) { var_dump($item); } foreach($stack as $item) { var_dump($item); }
Output for 5.3.0 - 7.2.6
int(19) int(17) int(13) int(19) int(17) int(13)
Output for 5.0.0 - 5.2.17
Fatal error: Class 'SplStack' not found in /in/Cm8M5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splstack in /in/Cm8M5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splstack in /in/Cm8M5 on line 3