3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = microtime(true); $stack = new SplStack(); $array = []; for ($i = 0; $i < 1000000; ++$i) { $stack->push($i); // $array[] = $i; } $tmp = 0; for ($i = 0; $i < 1000000; ++$i) { $tmp = $stack->pop(); // $tmp = array_pop($array); } echo microtime(true) - $start;
Output for 7.1.0
0.11548519134521
Output for 7.0.14
0.11349701881409
Output for 7.0.6
0.10489392280579
Output for 7.0.5
0.10914397239685
Output for 7.0.4
0.10179805755615
Output for 7.0.3
0.090914011001587
Output for 7.0.2
0.089574098587036
Output for 7.0.1
0.087711095809937
Output for 7.0.0
0.09555196762085
Output for hhvm-3.12.0

Process exited with code 137.
Output for hhvm-3.10.0
1.3980388641357
Output for 5.4.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /in/bqsrV on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/bqsrV on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/bqsrV on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/bqsrV on line 5
Process exited with code 255.