3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arreglo = array(34,2,7,1,90,45,87,23,10,8); //var_dump($arreglo); $mayor=null; $menor=null; function ordernar($a,$b) { if ($a>$b) return $b; else if ($b>=$a) return $a; } $limite = null; $ordenado = array(); $cantidad = count($arreglo); for ($i = 0; $i < $cantidad; $i++) { for ($j = $i+1; $j < $cantidad; $j++) { if (is_null($limite)) { if (is_null($menor)) $menor = ordernar($arreglo[$i],$arreglo[$j]); else if ($menor > ordernar($arreglo[$i],$arreglo[$j])) $menor = ordernar($arreglo[$i],$arreglo[$j]); }else { if (($limite==$arreglo[$i]) && ($arreglo[$i]<>$arreglo[$j])) { $menor = ordernar($arreglo[$j],$menor); } else if (($limite==$arreglo[$j]) && ($arreglo[$i]<>$arreglo[$j])) { $menor = ordernar($arreglo[$i],$menor); } else { if (is_null($menor)) $menor = ordernar($arreglo[$i],$arreglo[$j]); else if ($menor > ordernar($arreglo[$i],$arreglo[$j])) $menor = ordernar($arreglo[$i],$arreglo[$j]); } } } $limite = $menor; $ordenado = array_push($ordenado,$menor); $menor=null; } var_dump($ordenado);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: array_push(): Argument #1 ($array) must be of type array, int given in /in/OrSfo:50 Stack trace: #0 /in/OrSfo(50): array_push(1, 2) #1 {main} thrown in /in/OrSfo on line 50
Process exited with code 255.

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:
178.38 ms | 405 KiB | 5 Q