3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $starttime = microtime(true); $array = array(3,4,1,3,5,1,92,2,4124,424,52,12); for ($c=0;$c<100000;$c++) { for ($i=0;$i<count($array);$i++) { for ($y=0;$y<count($array)-1;$y++) { if ($array[$y+1] < $array[$y]) { $t = $array[$y]; $array[$y] = $array[$y+1]; $array[$y+1] = $t; } } } } print_r($array); echo microtime(true) - $starttime;
Output for 7.1.0
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) -0.10625910758972
Output for 7.0.14
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.14349985122681
Output for 7.0.6
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.69723606109619
Output for 7.0.5
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.6167299747467
Output for 7.0.4
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.5872278213501
Output for 7.0.3
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.60677886009216
Output for 7.0.2
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.61605286598206
Output for 7.0.1
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.60949897766113
Output for 7.0.0
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 0.59300899505615
Output for 5.6.28
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 2.4220678806305
Output for 5.6.21
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8109970092773
Output for 5.6.20
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8073878288269
Output for 5.6.19
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8420150279999
Output for 5.6.18
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9012439250946
Output for 5.6.17
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 2.0111420154572
Output for 5.6.16
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 2.0838730335236
Output for 5.6.15
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.840537071228
Output for 5.6.14
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 2.1407151222229
Output for 5.6.13
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8177170753479
Output for 5.6.12
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8378279209137
Output for 5.6.11
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9959118366241
Output for 5.6.10
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8550179004669
Output for 5.6.9
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8596038818359
Output for 5.6.8
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8819448947906
Output for 5.5.35
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8201780319214
Output for 5.5.34
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9360370635986
Output for 5.5.33
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9197912216187
Output for 5.5.32
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9407532215118
Output for 5.5.31
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9413628578186
Output for 5.5.30
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9058530330658
Output for 5.5.29
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 2.00306391716
Output for 5.5.28
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9133689403534
Output for 5.5.27
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9067690372467
Output for 5.5.26
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.947172164917
Output for 5.5.25
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9632611274719
Output for 5.5.24
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.7872610092163
Output for 5.4.45
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8798561096191
Output for 5.4.44
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8901858329773
Output for 5.4.43
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9238300323486
Output for 5.4.42
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.9109768867493
Output for 5.4.41
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.835086107254
Output for 5.4.40
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8614649772644
Output for 5.4.39
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8695039749146
Output for 5.4.38
Array ( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 3 [5] => 4 [6] => 5 [7] => 12 [8] => 52 [9] => 92 [10] => 424 [11] => 4124 ) 1.8544640541077
Output for 5.3.9 - 5.4.37

Process exited with code 137.