3v4l.org

run code in 300+ PHP versions simultaneously
<html> <?php $time = microtime(); // Create an array and push on the names // of your closest family and friends $family = array("mother", "father", "gmother", "gfather"); // Sort the list sort($family); rsort($family); // Randomly select a winner! $winner = ""; $win = rand(0,3); switch($win){ case 0: $winner = $family[0]; break; case 1: $winner = $family[1]; break; case 2: $winner = $family[2]; break; case 3: $winner = $family[3]; break; default: echo "Переможець не визначений!"; } // Print the winner's name in ALL CAPS echo strtoupper("І так, у нас є переможеце і це ......".$winner."\n"); echo microtime() - $time; exit; ?> <?php $time = microtime(); $countarray = null;//Кількість елементів масиву $player = null;//Гравець який випав //Масив гравців $array = array("Олексій Бродніков", "Андрій Андрощук", "Олег Любчук", "Андрій Ковальчук"); $countarray = count($array); $countarray --; echo "Масив ".$countarray."<br>"; if($player = rand(0,$countarray)){ echo "Переможець: ".$array[$player]."<br>".$player; } else{ echo "Переможець: ".$array[0]."<br>"; echo $player; exit; microtime() -$time; } </html>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.190.0110.04212.39
5.4.180.0120.04012.39
5.4.170.0110.03912.40
5.4.160.0140.04812.39
5.4.150.0090.04312.39
5.4.140.0090.04012.08
5.4.130.0100.04212.06
5.4.120.0090.04112.03
5.4.110.0100.04012.02
5.4.100.0130.04212.02
5.4.90.0110.04112.02
5.4.80.0100.04312.02
5.4.70.0120.04812.02
5.4.60.0120.04212.02
5.4.50.0100.04512.02
5.4.40.0110.04312.00
5.4.30.0120.04312.00
5.4.20.0110.04112.00
5.4.10.0090.03812.00
5.4.00.0110.03911.50
5.3.270.0140.05412.72
5.3.260.0090.04612.72
5.3.250.0110.04112.72
5.3.240.0090.04312.72
5.3.230.0120.04112.71
5.3.220.0110.04212.68
5.3.210.0110.04812.68
5.3.200.0160.05512.68
5.3.190.0100.04912.68
5.3.180.0100.04712.67
5.3.170.0120.04612.67
5.3.160.0100.04312.67
5.3.150.0130.04812.67
5.3.140.0120.04912.66
5.3.130.0180.06212.66
5.3.120.0100.04412.66
5.3.110.0110.04912.66
5.3.100.0090.04912.12
5.3.90.0110.04912.08
5.3.80.0100.05012.08
5.3.70.0110.04712.07
5.3.60.0160.04412.06
5.3.50.0140.06412.00
5.3.40.0150.04412.01
5.3.30.0120.04611.96
5.3.20.0150.04111.75
5.3.10.0100.04711.71
5.3.00.0120.04611.69

preferences:
140.15 ms | 1394 KiB | 7 Q