3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(); for ($i = 0; $i < 10000; ++$i) { $v = rand(1, 1000000); $a[] = $v; } echo "Size: ", count($a), PHP_EOL; $start = microtime( true ); for ($i = 0; $i < 10000; ++$i) { isset($a[rand(1, 1000000)]); } $total_time = microtime( true ) - $start; echo "Total time: ", number_format($total_time, 6), PHP_EOL; $start = microtime( true ); for ($i = 0; $i < 10000; ++$i) { in_array(rand(1, 1000000), $a); } $total_time = microtime( true ) - $start; echo "Total time: ", number_format($total_time, 6), PHP_EOL;
Output for 7.1.0
Size: 10000 Total time: 0.001251 Total time: 0.146697
Output for 7.0.14
Size: 10000 Total time: 0.001102 Total time: 0.154332
Output for 5.4.17
Size: 10000 Total time: 0.004632
Process exited with code 137.
Output for 5.4.16
Size: 10000 Total time: 0.004351 Total time: 2.149718
Output for 5.4.14
Size: 10000 Total time: 0.003325 Total time: 2.064533
Output for 5.4.13
Size: 10000 Total time: 0.002450 Total time: 2.149449
Output for 5.4.12
Size: 10000 Total time: 0.002816 Total time: 2.157493
Output for 5.4.11
Size: 10000 Total time: 0.002341 Total time: 1.953812
Output for 5.4.9
Size: 10000 Total time: 0.004507 Total time: 2.228859
Output for 5.4.8
Size: 10000 Total time: 0.004080 Total time: 1.946946
Output for 5.4.7
Size: 10000 Total time: 0.002449 Total time: 1.878858
Output for 5.4.6
Size: 10000 Total time: 0.004798 Total time: 2.071212
Output for 5.4.5
Size: 10000 Total time: 0.003105 Total time: 1.981958
Output for 5.4.4
Size: 10000 Total time: 0.002609 Total time: 1.901931
Output for 5.4.3
Size: 10000 Total time: 0.004056 Total time: 2.184257
Output for 5.4.2
Size: 10000 Total time: 0.004231 Total time: 1.904959
Output for 5.4.1
Size: 10000 Total time: 0.002261 Total time: 2.008193
Output for 5.4.0
Size: 10000 Total time: 0.004178 Total time: 2.315383
Output for 5.3.27
Size: 10000 Total time: 0.006704
Process exited with code 137.
Output for 5.3.25
Size: 10000 Total time: 0.002962 Total time: 2.088606
Output for 5.3.24
Size: 10000 Total time: 0.004762 Total time: 2.056841
Output for 5.3.23
Size: 10000 Total time: 0.003054 Total time: 2.050934
Output for 5.3.22
Size: 10000 Total time: 0.003344 Total time: 1.917501
Output for 5.3.21
Size: 10000 Total time: 0.002813 Total time: 1.910431
Output for 5.3.20
Size: 10000 Total time: 0.003980 Total time: 2.024196
Output for 5.3.19
Size: 10000 Total time: 0.002848 Total time: 2.062841
Output for 5.3.17
Size: 10000 Total time: 0.002875 Total time: 2.025395
Output for 5.3.16
Size: 10000 Total time: 0.005036 Total time: 1.906722
Output for 5.3.15
Size: 10000 Total time: 0.003647 Total time: 1.948217
Output for 5.3.14
Size: 10000 Total time: 0.003030 Total time: 1.986482
Output for 5.3.13
Size: 10000 Total time: 0.004935 Total time: 2.078059
Output for 5.3.12
Size: 10000 Total time: 0.002759 Total time: 1.939078
Output for 5.3.11
Size: 10000 Total time: 0.003086 Total time: 2.006091
Output for 5.3.10
Size: 10000 Total time: 0.003698 Total time: 1.944746
Output for 5.3.9
Size: 10000 Total time: 0.003128 Total time: 1.851875
Output for 5.3.8
Size: 10000 Total time: 0.003417 Total time: 1.909475
Output for 5.3.7
Size: 10000 Total time: 0.004669 Total time: 1.964889
Output for 5.3.6
Size: 10000 Total time: 0.004796 Total time: 2.002685
Output for 5.3.5
Size: 10000 Total time: 0.003334 Total time: 1.978053
Output for 5.3.4
Size: 10000 Total time: 0.004935 Total time: 2.042944
Output for 5.2.17
Size: 10000 Total time: 0.003034
Process exited with code 137.
Output for 5.2.16
Size: 10000 Total time: 0.003120
Process exited with code 137.
Output for 5.2.15
Size: 10000 Total time: 0.004228
Process exited with code 137.