3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('INT_COUNT',100000); // Fill an array with random ints $ints2 = array(); for ($i = 0; $i < INT_COUNT; $i++){ $ints2[] = rand(0, 255); } // asort the ints asort($ints2); $start = microtime(true); // Do nothing but access each int in the array for ($i = 0; $i < INT_COUNT; $i++){ $ints2[$i]; } $finish = microtime(true); printf("Time taken with asort(): %.7f seconds\n", $finish - $start); unset($ints2); // Now do it again, but this time use sort // Fill an array with random ints $ints = array(); for ($i = 0; $i < INT_COUNT; $i++){ $ints[] = rand(0, 255); } // Sort the ints sort($ints); $start = microtime(true); // Do nothing but access each int in the array for ($i = 0; $i < INT_COUNT; $i++){ $ints[$i]; } $finish = microtime(true); printf("Time taken with sort(): %.7f seconds\n", $finish - $start);
Output for 7.1.0
Time taken with asort(): 0.0031970 seconds Time taken with sort(): 0.0024071 seconds
Output for 7.0.14
Time taken with asort(): 0.0032549 seconds Time taken with sort(): 0.0026169 seconds
Output for 7.0.8
Time taken with asort(): 0.0034671 seconds Time taken with sort(): 0.0020089 seconds
Output for 7.0.7
Time taken with asort(): 0.0029502 seconds Time taken with sort(): 0.0019879 seconds
Output for 7.0.6
Time taken with asort(): 0.0029612 seconds Time taken with sort(): 0.0019040 seconds
Output for 7.0.5
Time taken with asort(): 0.0038240 seconds Time taken with sort(): 0.0019231 seconds
Output for 7.0.4
Time taken with asort(): 0.0029471 seconds Time taken with sort(): 0.0019011 seconds
Output for 7.0.3
Time taken with asort(): 0.0029261 seconds Time taken with sort(): 0.0019948 seconds
Output for 7.0.2
Time taken with asort(): 0.0030489 seconds Time taken with sort(): 0.0019660 seconds
Output for 7.0.1
Time taken with asort(): 0.0035689 seconds Time taken with sort(): 0.0022480 seconds
Output for 7.0.0
Time taken with asort(): 0.0029559 seconds Time taken with sort(): 0.0019841 seconds
Output for 5.6.23
Time taken with asort(): 0.0047619 seconds Time taken with sort(): 0.0123520 seconds
Output for 5.6.22
Time taken with asort(): 0.0048611 seconds Time taken with sort(): 0.0123210 seconds
Output for 5.6.21
Time taken with asort(): 0.0050321 seconds Time taken with sort(): 0.0124199 seconds
Output for 5.6.20
Time taken with asort(): 0.0045311 seconds Time taken with sort(): 0.0113099 seconds
Output for 5.6.19
Time taken with asort(): 0.0044751 seconds Time taken with sort(): 0.0116000 seconds
Output for 5.6.18
Time taken with asort(): 0.0054591 seconds Time taken with sort(): 0.0127928 seconds
Output for 5.6.17
Time taken with asort(): 0.0047441 seconds Time taken with sort(): 0.0117791 seconds
Output for 5.6.16
Time taken with asort(): 0.0055909 seconds Time taken with sort(): 0.0118480 seconds
Output for 5.6.15
Time taken with asort(): 0.0054250 seconds Time taken with sort(): 0.0112572 seconds
Output for 5.6.14
Time taken with asort(): 0.0044301 seconds Time taken with sort(): 0.0123150 seconds
Output for 5.6.13
Time taken with asort(): 0.0044079 seconds Time taken with sort(): 0.0121620 seconds
Output for 5.6.12
Time taken with asort(): 0.0045960 seconds Time taken with sort(): 0.0189450 seconds
Output for 5.6.11
Time taken with asort(): 0.0047672 seconds Time taken with sort(): 0.0147870 seconds
Output for 5.6.10
Time taken with asort(): 0.0052979 seconds Time taken with sort(): 0.0121679 seconds
Output for 5.6.9
Time taken with asort(): 0.0057402 seconds Time taken with sort(): 0.0118339 seconds
Output for 5.6.8
Time taken with asort(): 0.0066299 seconds Time taken with sort(): 0.0133340 seconds
Output for 5.6.7
Time taken with asort(): 0.0050170 seconds Time taken with sort(): 0.0123940 seconds
Output for 5.6.6
Time taken with asort(): 0.0049348 seconds Time taken with sort(): 0.0136392 seconds
Output for 5.6.5
Time taken with asort(): 0.0048399 seconds Time taken with sort(): 0.0152121 seconds
Output for 5.6.4
Time taken with asort(): 0.0049131 seconds Time taken with sort(): 0.0126979 seconds
Output for 5.6.3
Time taken with asort(): 0.0052791 seconds Time taken with sort(): 0.0138180 seconds
Output for 5.6.2
Time taken with asort(): 0.0044420 seconds Time taken with sort(): 0.0133898 seconds
Output for 5.6.1
Time taken with asort(): 0.0049510 seconds Time taken with sort(): 0.0111630 seconds
Output for 5.6.0
Time taken with asort(): 0.0052891 seconds Time taken with sort(): 0.0118532 seconds
Output for 5.5.37
Time taken with asort(): 0.0043890 seconds Time taken with sort(): 0.0120678 seconds
Output for 5.5.36
Time taken with asort(): 0.0044320 seconds Time taken with sort(): 0.0116000 seconds
Output for 5.5.35
Time taken with asort(): 0.0046110 seconds Time taken with sort(): 0.0117378 seconds
Output for 5.5.34
Time taken with asort(): 0.0045400 seconds Time taken with sort(): 0.0112131 seconds
Output for 5.5.33
Time taken with asort(): 0.0045171 seconds Time taken with sort(): 0.0123041 seconds
Output for 5.5.32
Time taken with asort(): 0.0053489 seconds Time taken with sort(): 0.0118880 seconds
Output for 5.5.31
Time taken with asort(): 0.0054061 seconds Time taken with sort(): 0.0128520 seconds
Output for 5.5.30
Time taken with asort(): 0.0045259 seconds Time taken with sort(): 0.0116301 seconds
Output for 5.5.29
Time taken with asort(): 0.0055230 seconds Time taken with sort(): 0.0113840 seconds
Output for 5.5.28
Time taken with asort(): 0.0045512 seconds Time taken with sort(): 0.0125642 seconds
Output for 5.5.27
Time taken with asort(): 0.0049090 seconds Time taken with sort(): 0.0148551 seconds
Output for 5.5.26
Time taken with asort(): 0.0055411 seconds Time taken with sort(): 0.0121980 seconds
Output for 5.5.25
Time taken with asort(): 0.0055039 seconds Time taken with sort(): 0.0129011 seconds
Output for 5.5.24
Time taken with asort(): 0.0055261 seconds Time taken with sort(): 0.0118632 seconds
Output for 5.5.23
Time taken with asort(): 0.0050609 seconds Time taken with sort(): 0.0122089 seconds
Output for 5.5.22
Time taken with asort(): 0.0054870 seconds Time taken with sort(): 0.0112078 seconds
Output for 5.5.21
Time taken with asort(): 0.0055549 seconds Time taken with sort(): 0.0131738 seconds
Output for 5.5.20
Time taken with asort(): 0.0054939 seconds Time taken with sort(): 0.0127270 seconds
Output for 5.5.19
Time taken with asort(): 0.0049391 seconds Time taken with sort(): 0.0120959 seconds
Output for 5.5.18
Time taken with asort(): 0.0047259 seconds Time taken with sort(): 0.0116701 seconds
Output for 5.5.16
Time taken with asort(): 0.0051758 seconds Time taken with sort(): 0.0120699 seconds
Output for 5.5.15
Time taken with asort(): 0.0045750 seconds Time taken with sort(): 0.0122249 seconds
Output for 5.5.14
Time taken with asort(): 0.0044060 seconds Time taken with sort(): 0.0127161 seconds
Output for 5.5.13
Time taken with asort(): 0.0047541 seconds Time taken with sort(): 0.0125310 seconds
Output for 5.5.12
Time taken with asort(): 0.0048130 seconds Time taken with sort(): 0.0130680 seconds
Output for 5.5.11
Time taken with asort(): 0.0056112 seconds Time taken with sort(): 0.0120461 seconds
Output for 5.5.10
Time taken with asort(): 0.0045161 seconds Time taken with sort(): 0.0139530 seconds
Output for 5.5.9
Time taken with asort(): 0.0046980 seconds Time taken with sort(): 0.0115790 seconds
Output for 5.5.8
Time taken with asort(): 0.0044260 seconds Time taken with sort(): 0.0127490 seconds
Output for 5.5.7
Time taken with asort(): 0.0051129 seconds Time taken with sort(): 0.0135970 seconds
Output for 5.5.6
Time taken with asort(): 0.0046351 seconds Time taken with sort(): 0.0191178 seconds
Output for 5.5.5
Time taken with asort(): 0.0052781 seconds Time taken with sort(): 0.0175400 seconds
Output for 5.5.4
Time taken with asort(): 0.0045869 seconds Time taken with sort(): 0.0161681 seconds
Output for 5.5.3
Time taken with asort(): 0.0048020 seconds Time taken with sort(): 0.0144372 seconds
Output for 5.5.2
Time taken with asort(): 0.0040319 seconds Time taken with sort(): 0.0143621 seconds
Output for 5.5.1
Time taken with asort(): 0.0045099 seconds Time taken with sort(): 0.0148571 seconds
Output for 5.5.0
Time taken with asort(): 0.0047369 seconds Time taken with sort(): 0.0143359 seconds
Output for 5.4.45
Time taken with asort(): 0.0046551 seconds Time taken with sort(): 0.0132930 seconds
Output for 5.4.44
Time taken with asort(): 0.0051651 seconds Time taken with sort(): 0.0133080 seconds
Output for 5.4.43
Time taken with asort(): 0.0047081 seconds Time taken with sort(): 0.0143681 seconds
Output for 5.4.42
Time taken with asort(): 0.0057271 seconds Time taken with sort(): 0.0125630 seconds
Output for 5.4.41
Time taken with asort(): 0.0054631 seconds Time taken with sort(): 0.0135829 seconds
Output for 5.4.40
Time taken with asort(): 0.0050139 seconds Time taken with sort(): 0.0117490 seconds
Output for 5.4.39
Time taken with asort(): 0.0050111 seconds Time taken with sort(): 0.0128720 seconds
Output for 5.4.38
Time taken with asort(): 0.0055342 seconds Time taken with sort(): 0.0140541 seconds
Output for 5.4.37
Time taken with asort(): 0.0052121 seconds Time taken with sort(): 0.0122962 seconds
Output for 5.4.36
Time taken with asort(): 0.0055590 seconds Time taken with sort(): 0.0134809 seconds
Output for 5.4.35
Time taken with asort(): 0.0047328 seconds Time taken with sort(): 0.0120099 seconds
Output for 5.4.34
Time taken with asort(): 0.0044608 seconds Time taken with sort(): 0.0120890 seconds
Output for 5.4.32
Time taken with asort(): 0.0062349 seconds Time taken with sort(): 0.0128841 seconds
Output for 5.4.31
Time taken with asort(): 0.0055170 seconds Time taken with sort(): 0.0122092 seconds
Output for 5.4.30
Time taken with asort(): 0.0047681 seconds Time taken with sort(): 0.0124011 seconds
Output for 5.4.29
Time taken with asort(): 0.0046141 seconds Time taken with sort(): 0.0115869 seconds
Output for 5.4.28
Time taken with asort(): 0.0046031 seconds Time taken with sort(): 0.0124261 seconds
Output for 5.4.27
Time taken with asort(): 0.0052660 seconds Time taken with sort(): 0.0136080 seconds
Output for 5.4.26
Time taken with asort(): 0.0047951 seconds Time taken with sort(): 0.0116260 seconds
Output for 5.4.25
Time taken with asort(): 0.0046830 seconds Time taken with sort(): 0.0124710 seconds
Output for 5.4.24
Time taken with asort(): 0.0047610 seconds Time taken with sort(): 0.0120599 seconds
Output for 5.4.23
Time taken with asort(): 0.0055079 seconds Time taken with sort(): 0.0112090 seconds
Output for 5.4.22
Time taken with asort(): 0.0045300 seconds Time taken with sort(): 0.0125651 seconds
Output for 5.4.21
Time taken with asort(): 0.0047529 seconds Time taken with sort(): 0.0158010 seconds
Output for 5.4.20
Time taken with asort(): 0.0052171 seconds Time taken with sort(): 0.0156901 seconds
Output for 5.4.19
Time taken with asort(): 0.0045989 seconds Time taken with sort(): 0.0141540 seconds
Output for 5.4.18
Time taken with asort(): 0.0044379 seconds Time taken with sort(): 0.0148561 seconds
Output for 5.4.17
Time taken with asort(): 0.0048139 seconds Time taken with sort(): 0.0138819 seconds
Output for 5.4.16
Time taken with asort(): 0.0041771 seconds Time taken with sort(): 0.0147600 seconds
Output for 5.4.15
Time taken with asort(): 0.0044780 seconds Time taken with sort(): 0.0152950 seconds
Output for 5.4.14
Time taken with asort(): 0.0044341 seconds Time taken with sort(): 0.0139520 seconds
Output for 5.4.13
Time taken with asort(): 0.0044370 seconds Time taken with sort(): 0.0126269 seconds
Output for 5.4.12
Time taken with asort(): 0.0044458 seconds Time taken with sort(): 0.0143220 seconds
Output for 5.4.11
Time taken with asort(): 0.0046380 seconds Time taken with sort(): 0.0105441 seconds
Output for 5.4.10
Time taken with asort(): 0.0046930 seconds Time taken with sort(): 0.0120091 seconds
Output for 5.4.9
Time taken with asort(): 0.0045888 seconds Time taken with sort(): 0.0115139 seconds
Output for 5.4.8
Time taken with asort(): 0.0046551 seconds Time taken with sort(): 0.0114589 seconds
Output for 5.4.7
Time taken with asort(): 0.0052090 seconds Time taken with sort(): 0.0129209 seconds
Output for 5.4.6
Time taken with asort(): 0.0048220 seconds Time taken with sort(): 0.0122552 seconds
Output for 5.4.5
Time taken with asort(): 0.0044291 seconds Time taken with sort(): 0.0125799 seconds
Output for 5.4.4
Time taken with asort(): 0.0044289 seconds Time taken with sort(): 0.0119679 seconds
Output for 5.4.3
Time taken with asort(): 0.0054791 seconds Time taken with sort(): 0.0128760 seconds
Output for 5.4.2
Time taken with asort(): 0.0053921 seconds Time taken with sort(): 0.0128579 seconds
Output for 5.4.1
Time taken with asort(): 0.0044639 seconds Time taken with sort(): 0.0126460 seconds
Output for 5.4.0
Time taken with asort(): 0.0044231 seconds Time taken with sort(): 0.0120242 seconds
Output for 5.3.29
Time taken with asort(): 0.0085230 seconds Time taken with sort(): 0.0111890 seconds
Output for 5.3.28
Time taken with asort(): 0.0093110 seconds Time taken with sort(): 0.0117590 seconds
Output for 5.3.27
Time taken with asort(): 0.0072470 seconds Time taken with sort(): 0.0137050 seconds
Output for 5.3.26
Time taken with asort(): 0.0068049 seconds Time taken with sort(): 0.0121250 seconds
Output for 5.3.25
Time taken with asort(): 0.0070629 seconds Time taken with sort(): 0.0136979 seconds
Output for 5.3.24
Time taken with asort(): 0.0061998 seconds Time taken with sort(): 0.0117760 seconds
Output for 5.3.23
Time taken with asort(): 0.0070541 seconds Time taken with sort(): 0.0131769 seconds
Output for 5.3.22
Time taken with asort(): 0.0070820 seconds Time taken with sort(): 0.0125201 seconds
Output for 5.3.21
Time taken with asort(): 0.0070031 seconds Time taken with sort(): 0.0126669 seconds
Output for 5.3.20
Time taken with asort(): 0.0073121 seconds Time taken with sort(): 0.0100961 seconds
Output for 5.3.19
Time taken with asort(): 0.0073419 seconds Time taken with sort(): 0.0102000 seconds
Output for 5.3.18
Time taken with asort(): 0.0074821 seconds Time taken with sort(): 0.0102570 seconds
Output for 5.3.17
Time taken with asort(): 0.0070090 seconds Time taken with sort(): 0.0100250 seconds
Output for 5.3.16
Time taken with asort(): 0.0088968 seconds Time taken with sort(): 0.0113080 seconds
Output for 5.3.15
Time taken with asort(): 0.0074370 seconds Time taken with sort(): 0.0134809 seconds
Output for 5.3.14
Time taken with asort(): 0.0092530 seconds Time taken with sort(): 0.0109880 seconds
Output for 5.3.13
Time taken with asort(): 0.0075049 seconds Time taken with sort(): 0.0118220 seconds
Output for 5.3.12
Time taken with asort(): 0.0071449 seconds Time taken with sort(): 0.0116081 seconds
Output for 5.3.11
Time taken with asort(): 0.0070171 seconds Time taken with sort(): 0.0106571 seconds
Output for 5.3.10
Time taken with asort(): 0.0078421 seconds Time taken with sort(): 0.0106628 seconds
Output for 5.3.9
Time taken with asort(): 0.0074129 seconds Time taken with sort(): 0.0109599 seconds
Output for 5.3.8
Time taken with asort(): 0.0070651 seconds Time taken with sort(): 0.0108180 seconds
Output for 5.3.7
Time taken with asort(): 0.0086348 seconds Time taken with sort(): 0.0109520 seconds
Output for 5.3.6
Time taken with asort(): 0.0082130 seconds Time taken with sort(): 0.0108650 seconds
Output for 5.3.5
Time taken with asort(): 0.0071409 seconds Time taken with sort(): 0.0102270 seconds
Output for 5.3.4
Time taken with asort(): 0.0084710 seconds Time taken with sort(): 0.0105829 seconds
Output for 5.3.3
Time taken with asort(): 0.0071340 seconds Time taken with sort(): 0.0111091 seconds
Output for 5.3.2
Time taken with asort(): 0.0071929 seconds Time taken with sort(): 0.0105679 seconds
Output for 5.3.1
Time taken with asort(): 0.0070391 seconds Time taken with sort(): 0.0104010 seconds
Output for 5.3.0
Time taken with asort(): 0.0089672 seconds Time taken with sort(): 0.0117869 seconds
Output for 5.2.17
Time taken with asort(): 0.0070250 seconds Time taken with sort(): 0.0110400 seconds
Output for 5.2.16
Time taken with asort(): 0.0084522 seconds Time taken with sort(): 0.0108371 seconds
Output for 5.2.15
Time taken with asort(): 0.0074780 seconds Time taken with sort(): 0.0117550 seconds
Output for 5.2.14
Time taken with asort(): 0.0083511 seconds Time taken with sort(): 0.0143578 seconds
Output for 5.2.13
Time taken with asort(): 0.0069330 seconds Time taken with sort(): 0.0109141 seconds
Output for 5.2.12
Time taken with asort(): 0.0086558 seconds Time taken with sort(): 0.0131149 seconds
Output for 5.2.11
Time taken with asort(): 0.0072510 seconds Time taken with sort(): 0.0125301 seconds
Output for 5.2.10
Time taken with asort(): 0.0071149 seconds Time taken with sort(): 0.0102580 seconds
Output for 5.2.9
Time taken with asort(): 0.0091641 seconds Time taken with sort(): 0.0102720 seconds
Output for 5.2.8
Time taken with asort(): 0.0086510 seconds Time taken with sort(): 0.0106161 seconds
Output for 5.2.7
Time taken with asort(): 0.0077569 seconds Time taken with sort(): 0.0109110 seconds
Output for 5.2.6
Time taken with asort(): 0.0089641 seconds Time taken with sort(): 0.0104060 seconds
Output for 5.2.5
Time taken with asort(): 0.0079060 seconds Time taken with sort(): 0.0102410 seconds
Output for 5.2.4
Time taken with asort(): 0.0072742 seconds Time taken with sort(): 0.0110931 seconds
Output for 5.2.3
Time taken with asort(): 0.0080750 seconds Time taken with sort(): 0.0108511 seconds
Output for 5.2.2
Time taken with asort(): 0.0078959 seconds Time taken with sort(): 0.0203061 seconds
Output for 5.2.1
Time taken with asort(): 0.0088630 seconds Time taken with sort(): 0.0127041 seconds
Output for 5.2.0
Time taken with asort(): 0.0073988 seconds Time taken with sort(): 0.0110960 seconds
Output for 5.1.6
Time taken with asort(): 0.0073421 seconds Time taken with sort(): 0.0121450 seconds
Output for 5.1.5
Time taken with asort(): 0.0077689 seconds Time taken with sort(): 0.0110500 seconds
Output for 5.1.4
Time taken with asort(): 0.0073762 seconds Time taken with sort(): 0.0116589 seconds
Output for 5.1.3
Time taken with asort(): 0.0071239 seconds Time taken with sort(): 0.0113642 seconds
Output for 5.1.2
Time taken with asort(): 0.0073400 seconds Time taken with sort(): 0.0112040 seconds
Output for 5.1.1
Time taken with asort(): 0.0075209 seconds Time taken with sort(): 0.0107899 seconds
Output for 5.1.0
Time taken with asort(): 0.0073359 seconds Time taken with sort(): 0.0126212 seconds
Output for 5.0.5
Time taken with asort(): 0.0217450 seconds Time taken with sort(): 0.0254140 seconds
Output for 5.0.4
Time taken with asort(): 0.0180461 seconds Time taken with sort(): 0.0225332 seconds
Output for 5.0.3
Time taken with asort(): 0.0179641 seconds Time taken with sort(): 0.0227890 seconds
Output for 5.0.2
Time taken with asort(): 0.0171161 seconds Time taken with sort(): 0.0216129 seconds
Output for 5.0.1
Time taken with asort(): 0.0199668 seconds Time taken with sort(): 0.0274949 seconds
Output for 5.0.0
Time taken with asort(): 0.0174680 seconds Time taken with sort(): 0.0229700 seconds
Output for 4.4.9
Time taken with asort(): 0.0183660 seconds Time taken with sort(): 0.0238320 seconds
Output for 4.4.8
Time taken with asort(): 0.0186030 seconds Time taken with sort(): 0.0268440 seconds
Output for 4.4.7
Time taken with asort(): 0.0159180 seconds Time taken with sort(): 0.0212100 seconds
Output for 4.4.6
Time taken with asort(): 0.0178020 seconds Time taken with sort(): 0.0223000 seconds
Output for 4.4.5
Time taken with asort(): 0.0157200 seconds Time taken with sort(): 0.0213210 seconds
Output for 4.4.4
Time taken with asort(): 0.0158560 seconds Time taken with sort(): 0.0204270 seconds
Output for 4.4.3
Time taken with asort(): 0.0191780 seconds Time taken with sort(): 0.0203740 seconds
Output for 4.4.2
Time taken with asort(): 0.0193330 seconds Time taken with sort(): 0.0226970 seconds
Output for 4.4.1
Time taken with asort(): 0.0162000 seconds Time taken with sort(): 0.0217640 seconds
Output for 4.4.0
Time taken with asort(): 0.0163480 seconds Time taken with sort(): 0.0209100 seconds
Output for 4.3.11
Time taken with asort(): 0.0182910 seconds Time taken with sort(): 0.0209940 seconds
Output for 4.3.10
Time taken with asort(): 0.0184150 seconds Time taken with sort(): 0.0256700 seconds
Output for 4.3.9
Time taken with asort(): 0.0156400 seconds Time taken with sort(): 0.0211130 seconds
Output for 4.3.8
Time taken with asort(): 0.0155950 seconds Time taken with sort(): 0.0208620 seconds
Output for 4.3.7
Time taken with asort(): 0.0184750 seconds Time taken with sort(): 0.0229180 seconds
Output for 4.3.6
Time taken with asort(): 0.0188820 seconds Time taken with sort(): 0.0219090 seconds
Output for 4.3.5
Time taken with asort(): 0.0162810 seconds Time taken with sort(): 0.0215930 seconds
Output for 4.3.4
Time taken with asort(): 0.0168190 seconds Time taken with sort(): 0.0256640 seconds
Output for 4.3.3
Time taken with asort(): 0.0182910 seconds Time taken with sort(): 0.0205510 seconds
Output for 4.3.2
Time taken with asort(): 0.0170410 seconds Time taken with sort(): 0.0277430 seconds
Output for 4.3.1
Time taken with asort(): 0.0155330 seconds Time taken with sort(): 0.0221340 seconds
Output for 4.3.0
Time taken with asort(): 0.0156050 seconds Time taken with sort(): 0.0213230 seconds