3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $starttime = microtime(true); $array = \SplFixedStorage::fromArray([3,4,1,3,5,1,92,2,4124,424,52,12]); $array_count = count($array); for ($c=0;$c<100000;$c++) { for ($i=0;$i<$array_count;$i++) { for ($y=0;$y<$array_count-1;$y++) { if ($array[$y+1] < $array[$y]) { $t = $array[$y]; $array[$y] = $array[$y+1]; $array[$y+1] = $t; } } } } echo microtime(true) - $starttime;
based on UsI4i
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'SplFixedStorage' not found in /in/Dk4ov:4 Stack trace: #0 {main} thrown in /in/Dk4ov on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Class undefined: SplFixedStorage in /in/Dk4ov on line 4
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Class 'SplFixedStorage' not found in /in/Dk4ov on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/Dk4ov on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Dk4ov on line 4 Parse error: syntax error, unexpected '[', expecting ')' in /in/Dk4ov on line 4
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
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Dk4ov on line 4 Parse error: parse error, unexpected '[', expecting ')' in /in/Dk4ov on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/Dk4ov on line 4 Parse error: parse error, expecting `')'' in /in/Dk4ov on line 4
Process exited with code 255.