3v4l.org

run code in 300+ PHP versions simultaneously
<?php function aff($t){ for($i=0;$i<count($t);$i++){ echo $t[$i]." "; } echo "<br />"; } function tablTrie($t){ for($i=0; $i < count($t)-1; $i++){ if($t[$i]>$t[$i+1]){return false;} } return true; } function trier(&$t){ if(!tablTrie($t)){trier2($t);} } function permuter (&$t,$i,$j){ $save=$t[$i]; $t[$i]=$t[$j]; $t[$j]=$save; } function trier2($t){ $u=0; for($i=0;$i<count($t)-1;$i++){ while($t[$i]>$t[$i+1]){ if($t[$i]>$t[$u]){$u=$u+1;} permuter($t,$u,$i); } } } //exemple d'appel $t=array(1,2,11,24,19,28,12,16,3,4,5,6,7,8,9,10); aff($t). "<br>"; trier($t); aff($t). "<br>"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
1 2 11 24 19 28 12 16 3 4 5 6 7 8 9 10 <br />1 2 11 24 19 28 12 16 3 4 5 6 7 8 9 10 <br />

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.05 ms | 401 KiB | 8 Q