3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array("url" => "http://google.com", "priority" => 3), array("url" => "http://facebook.com", "priority" => 2), array("url" => "http://youtube.com", "priority" => 2), array("url" => "http://stackoverflow.com", "priority" => 1), array("url" => "http://kickass.to", "priority" => 1), array("url" => "http://twitter.com", "priority" => 1), array("url" => "http://example.com", "priority" => 1), ); // Recreate another array where we have multiple occurence of the same value (nb_of_occurence = priority) $listOfUrl = array(); foreach ($arr as $url) { $nbOfOccurence = $url['priority']; for($i = 0 ; $i < $nbOfOccurence ; $i++) { $listOfUrl[] = $url['url']; } } // Count the number of elements in this new array $nbOfElement = count($listOfUrl); // Generate a random index between 0 and (number of element - 1) $randomIndex = rand(0,($nbOfElement - 1)); // Retrive the random value $randomURL = $listOfUrl[$randomIndex]; echo $randomURL;

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.4.00.0040.01114.63
7.3.120.0100.01014.58
7.3.110.0140.00014.96
7.3.100.0000.01314.54
7.3.90.0030.00714.93
7.3.80.0070.00714.81
7.3.70.0100.00314.72
7.3.60.0070.01014.94
7.3.50.0110.00714.66
7.3.40.0070.01014.73
7.3.30.0070.00714.82
7.3.20.0110.00416.64
7.3.10.0100.00316.88
7.3.00.0120.00316.59
7.2.250.0090.01215.04
7.2.240.0120.00615.18
7.2.230.0000.01215.08
7.2.220.0090.00615.03
7.2.210.0030.00815.30
7.2.200.0050.00714.96
7.2.190.0090.00914.88
7.2.180.0100.00715.11
7.2.170.0000.01415.17
7.2.00.0040.00819.47
7.1.330.0000.01415.79
7.1.320.0060.00615.73
7.1.310.0030.01015.77
7.1.300.0060.01315.76
7.1.290.0030.00615.77
7.1.280.0070.00315.78
7.1.270.0030.00915.51
7.1.260.0070.00415.64
7.1.70.0050.00217.34
7.1.60.0060.01819.46
7.1.50.0110.01117.01
7.1.00.0100.06722.47
7.0.200.0050.00316.86
7.0.140.0070.07021.96
7.0.70.0070.08319.96
7.0.60.0100.06319.95
7.0.50.0100.07020.35
7.0.40.0100.04019.95
7.0.30.0000.06720.11
7.0.20.0030.07320.10
7.0.10.0000.07019.99
7.0.00.0070.09320.10
5.6.280.0100.06320.86
5.6.220.0000.08320.73
5.6.210.0170.07720.49
5.6.200.0170.07720.96
5.6.190.0030.05721.10
5.6.180.0070.08721.01
5.6.170.0130.07720.96
5.6.160.0070.07720.93
5.6.150.0200.07021.04
5.6.140.0030.09021.11
5.6.130.0130.07721.01
5.6.120.0100.07720.95
5.6.110.0100.08021.02
5.6.100.0130.06021.12
5.6.90.0030.06020.91
5.6.80.0130.07320.42
5.6.70.0100.07320.47
5.6.60.0170.07320.47
5.6.50.0030.08320.42
5.6.40.0070.07720.38
5.6.30.0000.08720.30
5.6.20.0070.03720.45
5.6.10.0030.05020.45
5.6.00.0030.04020.44
5.5.360.0070.07320.35
5.5.350.0170.04020.39
5.5.340.0170.07720.86
5.5.330.0170.07020.92
5.5.320.0070.07720.91
5.5.310.0030.08720.91
5.5.300.0070.04720.79
5.5.290.0030.06720.86
5.5.280.0070.04020.89
5.5.270.0130.08720.80
5.5.260.0170.07320.86
5.5.250.0030.08020.64
5.5.240.0030.06720.21
5.5.230.0100.07320.20
5.5.220.0030.07720.16
5.5.210.0070.08320.26
5.5.200.0000.08720.18
5.5.190.0170.07320.12
5.5.180.0100.07320.27
5.5.160.0000.04320.18
5.5.150.0130.07320.15
5.5.140.0170.07020.13
5.5.130.0070.04320.15
5.5.120.0070.08020.14
5.5.110.0070.05020.17
5.5.100.0100.07720.11
5.5.90.0200.06720.07
5.5.80.0130.07320.13
5.5.70.0100.08320.12
5.5.60.0030.08720.09
5.5.50.0030.05720.10
5.5.40.0000.06320.09
5.5.30.0030.08320.07
5.5.20.0070.08020.07
5.5.10.0170.07320.04
5.5.00.0030.08319.95
5.4.450.0100.07319.47
5.4.440.0070.04019.42
5.4.430.0100.05319.40
5.4.420.0000.04719.27
5.4.410.0030.08319.22
5.4.400.0000.09019.23
5.4.390.0070.08319.24
5.4.380.0070.06318.98
5.4.370.0070.07719.14
5.4.360.0170.07019.11
5.4.350.0130.06719.02
5.4.340.0070.04718.81
5.4.320.0070.07019.23
5.4.310.0070.06019.03
5.4.300.0070.06318.89
5.4.290.0070.08018.94
5.4.280.0030.07319.23
5.4.270.0030.04718.96
5.4.260.0070.06319.14
5.4.250.0170.07318.92
5.4.240.0100.07319.14
5.4.230.0100.07718.80
5.4.220.0100.05319.13
5.4.210.0100.07318.95
5.4.200.0000.06019.05
5.4.190.0070.07319.14
5.4.180.0070.04719.13
5.4.170.0000.08718.95
5.4.160.0100.05018.79
5.4.150.0100.05718.95
5.4.140.0130.04316.28
5.4.130.0130.04316.27
5.4.120.0100.06716.39
5.4.110.0000.07716.21
5.4.100.0000.05316.41
5.4.90.0070.04316.34
5.4.80.0030.07716.39
5.4.70.0070.07316.29
5.4.60.0030.05316.23
5.4.50.0000.05316.35
5.4.40.0070.04316.24
5.4.30.0030.06316.20
5.4.20.0100.06316.27
5.4.10.0000.08016.14
5.4.00.0030.05715.81
5.3.290.0100.06314.67
5.3.280.0170.06314.42
5.3.270.0070.06314.46
5.3.260.0030.08314.56
5.3.250.0030.08314.57
5.3.240.0070.07714.43
5.3.230.0130.07014.46
5.3.220.0100.06014.51
5.3.210.0070.04314.58
5.3.200.0170.06014.58
5.3.190.0030.06314.54
5.3.180.0070.08014.52
5.3.170.0070.07714.55
5.3.160.0030.08714.58
5.3.150.0070.07014.50
5.3.140.0130.05014.50
5.3.130.0030.08314.49
5.3.120.0100.07714.53
5.3.110.0130.07014.46
5.3.100.0070.06713.95
5.3.90.0030.05014.03
5.3.80.0070.07713.79
5.3.70.0030.08013.99
5.3.60.0030.07713.96
5.3.50.0000.06313.94
5.3.40.0000.04713.81
5.3.30.0030.04313.79
5.3.20.0030.07013.66
5.3.10.0100.07313.63
5.3.00.0100.07013.55
5.2.170.0000.06011.21
5.2.160.0030.03710.94
5.2.150.0100.04311.18
5.2.140.0070.06011.18
5.2.130.0030.06010.94
5.2.120.0100.05711.11
5.2.110.0000.05011.18
5.2.100.0070.04011.17
5.2.90.0100.03310.99
5.2.80.0030.05011.08
5.2.70.0070.06311.14
5.2.60.0070.05010.91
5.2.50.0030.06011.02
5.2.40.0000.06711.00
5.2.30.0130.05010.83
5.2.20.0130.05310.82
5.2.10.0000.06310.86
5.2.00.0030.05710.68
5.1.60.0030.05010.68
5.1.50.0030.04010.68
5.1.40.0070.04710.68
5.1.30.0000.06310.68
5.1.20.0100.05010.68
5.1.10.0000.06010.68
5.1.00.0070.05010.68
5.0.50.0030.05010.68
5.0.40.0000.04710.68
5.0.30.0100.03710.68
5.0.20.0030.02710.68
5.0.10.0070.02710.68
5.0.00.0030.04010.68
4.4.90.0100.03010.68
4.4.80.0000.02710.68
4.4.70.0070.02710.68
4.4.60.0030.03310.68
4.4.50.0000.03710.68
4.4.40.0030.05310.68
4.4.30.0070.03310.68
4.4.20.0000.03710.68
4.4.10.0030.03010.68
4.4.00.0000.05310.68
4.3.110.0030.03310.68
4.3.100.0000.02710.68
4.3.90.0030.03010.68
4.3.80.0000.03710.68
4.3.70.0000.02310.68
4.3.60.0030.03310.68
4.3.50.0000.03710.68
4.3.40.0070.05010.68
4.3.30.0000.03310.68
4.3.20.0000.03010.68
4.3.10.0000.03310.68
4.3.00.0000.03010.68

preferences:
43.4 ms | 401 KiB | 5 Q