3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create an array and push on the names // of your closest family and friends $everyone = array("Tsuji", "Cover", "WildWind", "Grim", "Cupcake", "SoulWind", "Madara"); $contestants = array(); $numcontestants = rand(3,5); for ($i = 1; $i <= $numcontestants; $i++) { $indextoadd = rand(0,count($everyone)-1); array_push($contestants,$everyone[$indextoadd]); array_splice($everyone,$indextoadd,1); $search = true; } // Sort the list sort($contestants); ?> <h3>Contestants</h3> <ul> <?php foreach ($contestants as $person) { echo "<li>{$person}"; } ?> </ul> <?php // Randomly select a winner! $winner = $contestants[rand(0,count($contestants)-1)]; // Print the winner's name in ALL CAPS echo "<p>The winner is " . strtoupper($winner) . "!</p>"; ?>

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)
7.2.00.0030.01019.48
7.1.70.0000.01017.25
7.1.60.0180.00719.82
7.1.50.0100.01417.05
7.1.00.0030.07722.31
7.0.200.0090.00616.84
7.0.140.0030.07721.95
7.0.60.0100.05320.07
7.0.50.0000.09317.67
7.0.40.0100.06720.23
7.0.30.0630.05720.21
7.0.20.0300.05020.02
7.0.10.0070.07720.20
7.0.00.0030.04320.19
5.6.280.0100.06720.99
5.6.210.0130.07320.52
5.6.200.0030.04018.15
5.6.190.0030.06720.61
5.6.180.0330.04720.64
5.6.170.0300.04320.71
5.6.160.0030.04020.39
5.6.150.0030.05718.13
5.6.140.0070.08018.14
5.6.130.0130.08318.14
5.6.120.0070.08320.96
5.6.110.0070.08720.96
5.6.100.0070.04021.14
5.6.90.0100.07320.93
5.6.80.0100.06020.36
5.5.350.0070.08020.32
5.5.340.0000.04717.89
5.5.330.0030.07020.13
5.5.320.0300.05020.20
5.5.310.0270.07720.34
5.5.300.0000.04317.91
5.5.290.0030.05317.92
5.5.280.0070.04020.80
5.5.270.0100.04020.84
5.5.260.0170.08020.84
5.5.250.0170.07020.66
5.5.240.0300.06320.36
5.4.450.3300.04319.12
5.4.440.3430.03319.13
5.4.430.3970.04719.54
5.4.420.3930.03719.40
5.4.410.2970.04019.29
5.4.400.0330.03318.94
5.4.390.0570.06319.25
5.4.380.0200.05019.09
5.4.370.0300.03319.08
5.4.360.0230.04019.10
5.4.350.0270.07019.25
5.4.340.0230.04019.11
5.4.320.0100.04719.06
5.4.310.0100.05019.25
5.4.300.0170.04318.79
5.4.290.0270.07019.05
5.4.280.0330.07019.07
5.4.270.0130.04318.88
5.4.260.0230.03019.13
5.4.250.0300.06719.25
5.4.240.0330.06718.78
5.4.230.0230.03719.10
5.4.220.0230.05019.08
5.4.210.0200.03719.13
5.4.200.0270.04318.80
5.4.190.0300.05319.10
5.4.180.0170.04018.92
5.4.170.0300.04719.05
5.4.160.0330.07018.86
5.4.150.0300.07718.86
5.4.140.0230.05316.18
5.4.130.0230.04716.43
5.4.120.0370.07016.27
5.4.110.0330.05016.50
5.4.100.0330.07016.43
5.4.90.0330.06316.46
5.4.80.0270.07316.37
5.4.70.0400.05716.18
5.4.60.0330.07016.21
5.4.50.0300.06716.47
5.4.40.0200.06716.38
5.4.30.0300.04716.31
5.4.20.0300.07316.36
5.4.10.0130.05016.36
5.4.00.0070.03315.73
5.3.290.0300.06014.61
5.3.280.0370.06314.64
5.3.270.0230.03714.46
5.3.260.0300.07014.55
5.3.250.0230.03714.56
5.3.240.0370.06714.66
5.3.230.0330.07014.63
5.3.220.0330.06314.44
5.3.210.0230.05314.40
5.3.200.0430.06314.59
5.3.190.0270.07314.51
5.3.180.0370.04014.52
5.3.170.0330.05314.40
5.3.160.0300.05314.39
5.3.150.0400.06014.65
5.3.140.0300.04714.54
5.3.130.0170.04314.52
5.3.120.0270.04314.50
5.3.110.0130.08014.64
5.3.100.0070.04713.99
5.3.90.4170.03313.96
5.3.80.4030.03713.82
5.3.70.3530.04014.05
5.3.60.3770.04313.84
5.3.50.3500.04313.89
5.3.40.3600.04013.80
5.3.30.3900.04013.75
5.3.20.3430.03313.54
5.3.10.3430.03313.54
5.3.00.3530.03713.54
5.2.170.2900.03311.17
5.2.160.2770.02311.09
5.2.150.3030.02711.18
5.2.140.3070.02711.24
5.2.130.2930.02710.95
5.2.120.3130.03710.95
5.2.110.3170.03310.96
5.2.100.2800.03311.05
5.2.90.3200.02711.21
5.2.80.2900.02710.99
5.2.70.3000.03010.95
5.2.60.2470.03310.96
5.2.50.2900.03010.96
5.2.40.1700.02311.05
5.2.30.0030.03010.82
5.2.20.0000.03010.87
5.2.10.0000.03010.78
5.2.00.0630.02710.80
5.1.60.1800.0209.98
5.1.50.2130.0239.98
5.1.40.0000.0279.96
5.1.30.0070.02010.34
5.1.20.0000.02710.47
5.1.10.0030.02310.17
5.1.00.0630.0209.97
5.0.50.0900.0208.72
5.0.40.0870.0208.54
5.0.30.0730.0338.36
5.0.20.1070.0238.29
5.0.10.0900.0208.11
5.0.00.0830.0278.15
4.4.90.1100.0177.07
4.4.80.1100.0137.07
4.4.70.0000.0177.07
4.4.60.0000.0177.07
4.4.50.0000.0177.07
4.4.40.1000.0277.07
4.4.30.0300.0177.07
4.4.20.0000.0177.07
4.4.10.0970.0177.07
4.4.00.0870.0207.07
4.3.110.0870.0177.07
4.3.100.0930.0177.07
4.3.90.1100.0177.07
4.3.80.1130.0237.07
4.3.70.1500.0137.07
4.3.60.1430.0177.07
4.3.50.1470.0207.07
4.3.40.1330.0307.07
4.3.30.0730.0237.07
4.3.20.0630.0207.07
4.3.10.0600.0177.07
4.3.00.0630.0237.07

preferences:
37.63 ms | 400 KiB | 5 Q