3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $num = 23; $base = 2; $stack = new SplStack(); while( $num > 0) { $stack->push($num % $base); $num = (int) $num/$base; // no integer division } $stack->rewind(); while( $stack->valid() ) { $num = $stack->current(); if ($num > 0) { echo $num; $stack->next(); } } echo "\n";
Output for 5.3.0 - 7.1.0

Process exited with code 137.
Output for 5.0.0 - 5.2.17
Fatal error: Class 'SplStack' not found in /in/Pr4Ul on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splstack in /in/Pr4Ul on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splstack in /in/Pr4Ul on line 4