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;
based on MIA2p

Abusive script

This script was stopped while abusing our resources

Output for 7.0.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.3340249061584
Output for 7.0.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 ) -0.69937705993652
Output for 7.0.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.2024259567261
Output for 7.0.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.1201250553131
Output for 7.0.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.1346309185028
Output for 7.0.7
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.2901091575623
Output for 4.3.0 - 5.6.27, 7.0.6

Process exited with code 137.
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 ) 1.0234990119934
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.55970883369446
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.70923900604248
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 ) 1.2181489467621
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.82778787612915
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 ) 1.1788051128387