3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $stack = new SplStack(); $stack->push('a'); $stack->push('b'); $stack->push('c'); $stack->offsetSet(0, 'C'); # the last element has index zero $stack->rewind(); while( $stack->valid() ) { echo $stack->current(), PHP_EOL; $stack->next(); }
Output for 5.3.0 - 7.1.0
C b a
Output for 5.0.0 - 5.2.17
Fatal error: Class 'SplStack' not found in /in/slsiH on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splstack in /in/slsiH on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splstack in /in/slsiH on line 2