3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = ['Adamino', 'Pete', 'Mark', 'Gonz']; $pairs = []; $plucked = array_rand($names, 2); $iteration = 0; while (count($names) > 0) { ++$iteration; if ($iteration > 10) break; $pair = [$names[$plucked[0]], $names[$plucked[1]]]; unset($names[$plucked[0]], $names[$plucked[1]]); $pairs[] = $pair; } $result = "The PP randomizer has selected: \n"; foreach ($pairs as $p) { $result .= " -> {$p[0]} and {$p[1]}\n"; }

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.10.0110.00614.61
7.4.00.0170.00015.14
7.3.130.0080.01214.55
7.3.120.0070.01014.80
7.3.110.0070.00715.01
7.3.100.0070.00714.80
7.3.90.0070.01014.85
7.3.80.0060.00614.72
7.3.70.0030.00714.90
7.3.60.0060.00614.73
7.3.50.0140.00014.96
7.3.40.0040.01114.73
7.3.30.0030.01014.74
7.3.20.0060.00316.48
7.3.10.0150.00016.84
7.3.00.0090.00316.89
7.2.260.0030.01415.17
7.2.250.0070.01015.26
7.2.240.0030.00915.03
7.2.230.0060.00914.92
7.2.220.0030.01415.18
7.2.210.0040.00715.02
7.2.200.0070.00715.10
7.2.190.0030.01015.15
7.2.180.0000.00915.13
7.2.170.0000.01114.88
7.2.160.0040.01114.98
7.2.150.0100.00316.73
7.2.140.0110.00417.02
7.2.130.0060.00916.93
7.2.120.0030.01316.76
7.2.110.0060.00617.06
7.2.100.0090.00616.92
7.2.90.0070.00717.00
7.2.80.0000.01616.87
7.2.70.0110.00317.07
7.2.60.0040.00817.04
7.2.50.0090.00617.14
7.2.40.0060.01316.88
7.2.30.0070.00717.00
7.2.20.0040.00717.00
7.2.10.0060.00616.96
7.2.00.0030.00916.92
7.1.330.0070.00315.48
7.1.320.0030.01315.70
7.1.310.0040.01115.95
7.1.300.0060.00615.82
7.1.290.0030.01015.96
7.1.280.0030.00915.88
7.1.270.0100.00315.88
7.1.260.0000.00915.69
7.1.250.0040.00715.96
7.1.240.0040.01115.87
7.1.230.0040.00715.64
7.1.220.0080.00415.79
7.1.210.0030.00715.87
7.1.200.0030.00615.71
7.1.190.0030.00715.97
7.1.180.0000.01215.99
7.1.170.0000.00815.58
7.1.160.0070.00715.63
7.1.150.0040.01115.63
7.1.140.0080.00415.91
7.1.130.0080.00415.53
7.1.120.0030.00515.87
7.1.110.0030.00715.95
7.1.100.0040.00815.88
7.1.90.0000.01215.70
7.1.80.0000.00815.71
7.1.70.0110.00616.63
7.1.60.0160.01125.48
7.1.50.0120.00825.27
7.1.40.0120.01225.01
7.1.30.0120.01025.17
7.1.20.0150.00925.07
7.1.10.0090.00916.15
7.1.00.0070.00816.34
7.0.330.0110.00015.30
7.0.320.0030.01015.21
7.0.310.0060.00315.45
7.0.300.0080.00415.55
7.0.290.0000.01015.26
7.0.280.0000.01315.14
7.0.270.0000.01315.30
7.0.260.0080.00315.33
7.0.250.0030.00615.47
7.0.240.0080.00015.39
7.0.230.0030.00615.34
7.0.220.0030.00715.30
7.0.210.0060.00615.50
7.0.200.0080.01015.96
7.0.190.0050.00815.86
7.0.180.0060.01115.71
7.0.170.0050.01315.94
7.0.160.0040.01115.89
7.0.150.0080.01015.96
7.0.140.0070.00915.87
7.0.130.0070.00716.07
7.0.120.0050.01016.08
7.0.110.0240.00915.96
7.0.100.0030.01515.71
7.0.90.0060.01115.99
7.0.80.0030.01216.00
7.0.70.0050.01315.90
7.0.60.0040.01015.71
7.0.50.0240.01414.86
7.0.40.0280.01114.01
7.0.30.0230.01614.19
7.0.20.0360.01114.97
7.0.10.0110.00814.87
7.0.00.0100.00614.91
5.6.400.0130.00013.91
5.6.390.0000.01414.38
5.6.380.0060.00914.58
5.6.370.0000.01314.37
5.6.360.0070.01014.77
5.6.350.0000.00914.79
5.6.340.0090.00314.74
5.6.330.0060.00614.36
5.6.320.0000.01014.62
5.6.310.0120.00614.46
5.6.300.0060.00314.69
5.6.290.0060.00614.61
5.6.280.0030.00614.39
5.6.270.0030.00614.75
5.6.260.0000.01114.64
5.6.250.0090.00614.40
5.6.240.0060.00614.40
5.6.230.0030.00914.70
5.6.220.0030.00614.38
5.6.210.0030.01314.46
5.6.200.0030.01014.25
5.6.190.0030.00514.37
5.6.180.0030.01014.34
5.6.170.0100.00314.47
5.6.160.0030.00614.23
5.6.150.0130.00014.16
5.6.140.0140.00014.30
5.6.130.0030.00914.19
5.6.120.0000.01814.46
5.6.110.0030.00614.42
5.6.100.0090.00314.50
5.6.90.0070.00714.29
5.6.80.0030.00814.28
5.6.70.0100.00314.45
5.6.60.0060.00614.36
5.6.50.0060.00614.20
5.6.40.0090.00914.45
5.6.30.0070.00714.37
5.6.20.0070.00714.57
5.6.10.0000.01414.37
5.6.00.0080.00314.55

preferences:
33 ms | 401 KiB | 5 Q