3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array_fill(0, 1000000, 'hello'); $start = microtime(true); foreach ($arr as $ar) {} echo 'Array Iteration :' . round(microtime(true) - $start, 4) . "\n"; $arr = SplFixedArray::fromArray($arr); $start = microtime(true); foreach ($arr as $ar) {} echo 'SPL Iteration :' . round(microtime(true) - $start, 4) . "\n";
Output for 7.1.0
Array Iteration :0.0109 SPL Iteration :0.0237
Output for 7.0.14
Array Iteration :0.0104 SPL Iteration :0.0241
Output for 7.0.6
Array Iteration :0.0075 SPL Iteration :0.0184
Output for 7.0.5
Array Iteration :0.0076 SPL Iteration :0.0178
Output for 7.0.4
Array Iteration :0.0091 SPL Iteration :0.0214
Output for 7.0.3
Array Iteration :0.0074 SPL Iteration :0.0171
Output for 7.0.2
Array Iteration :0.0071 SPL Iteration :0.0172
Output for 7.0.1
Array Iteration :0.0067 SPL Iteration :0.017
Output for 7.0.0
Array Iteration :0.0067 SPL Iteration :0.0172
Output for hhvm-3.12.0
Array Iteration :0.0251 SPL Iteration :0.6065
Output for hhvm-3.10.0
Array Iteration :0.0239 SPL Iteration :0.781
Output for 5.4.0 - 5.6.28
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 72 bytes) in /in/2Ob1T on line 4
Process exited with code 255.
Output for 5.2.1 - 5.3.29
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /in/2Ob1T on line 4
Process exited with code 255.
Output for 5.2.0
Array Iteration :0.0584 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.6
Array Iteration :0.0454 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.5
Array Iteration :0.0623 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.4
Array Iteration :0.0478 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.3
Array Iteration :0.0433 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.2
Array Iteration :0.0524 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.1
Array Iteration :0.0899 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.1.0
Array Iteration :0.0485 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.0.5
Array Iteration :0.2274 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.0.4
Array Iteration :0.1937 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.0.3
Array Iteration :0.1962 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.0.2
Array Iteration :0.2002 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.0.1
Array Iteration :0.2432 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 5.0.0
Array Iteration :0.2022 Fatal error: Class 'SplFixedArray' not found in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.9
Array Iteration :0.1253 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.8
Array Iteration :0.1248 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.7
Array Iteration :0.0801 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.6
Array Iteration :0.0958 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.5
Array Iteration :0.1162 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.4
Array Iteration :0.1084 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.3
Array Iteration :0.1238 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.2
Array Iteration :0.1778 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.1
Array Iteration :0.189 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.4.0
Array Iteration :0.1675 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.11
Array Iteration :0.138 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.10
Array Iteration :0.1989 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.9
Array Iteration :0.27 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.8
Array Iteration :0.2468 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.7
Array Iteration :0.269 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.6
Array Iteration :0.1987 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.5
Array Iteration :0.2646 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.4
Array Iteration :0.3113 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.3
Array Iteration :-0.6662 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.2
Array Iteration :0.3868 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Process exited with code 255.
Output for 4.3.1
Array Iteration :-0.709 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10
Output for 4.3.0
Array Iteration :0.2597 Fatal error: Undefined class name 'splfixedarray' in /in/2Ob1T on line 10