3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array ("red","green","blue","yellow","brown"); $random_keys=array_rand($a,3); echo $a[$random_keys[0]]."<br>"; echo $a[$random_keys[1]]."<br>"; echo $a[$random_keys[2]]; ?>

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.0130.00314.82
7.4.00.0040.01414.61
7.3.130.0040.01414.67
7.3.120.0100.01014.93
7.3.110.0130.00314.71
7.3.100.0070.00614.98
7.3.90.0060.00614.76
7.3.80.0100.00314.64
7.3.70.0070.00614.74
7.3.60.0080.00014.55
7.3.50.0120.00914.80
7.3.40.0040.01114.54
7.3.30.0090.00014.89
7.3.20.0070.00716.39
7.3.10.0040.00816.77
7.3.00.0060.01216.50
7.2.260.0090.00914.86
7.2.250.0100.00615.12
7.2.240.0030.01015.38
7.2.230.0100.00314.89
7.2.220.0040.01215.07
7.2.210.0030.00615.29
7.2.200.0060.01015.09
7.2.190.0000.01215.07
7.2.180.0070.01114.94
7.2.170.0070.00314.95
7.2.160.0030.00914.98
7.2.150.0060.00317.06
7.2.140.0030.00616.98
7.2.130.0000.01816.91
7.2.120.0000.01416.79
7.2.110.0080.00617.16
7.2.100.0070.00716.68
7.2.90.0030.00717.02
7.2.80.0060.00917.06
7.2.70.0030.01017.10
7.2.60.0070.00716.94
7.2.50.0070.01017.12
7.2.40.0040.00716.61
7.2.30.0070.01017.04
7.2.20.0030.01016.93
7.2.10.0030.01016.95
7.2.00.0030.00616.71
7.1.330.0040.00815.44
7.1.320.0030.00615.79
7.1.310.0000.01415.88
7.1.300.0140.00315.91
7.1.290.0040.01115.67
7.1.280.0060.00915.77
7.1.270.0090.00315.49
7.1.260.0050.00915.39
7.1.250.0030.00615.65
7.1.240.0090.00315.49
7.1.230.0130.00015.70
7.1.220.0030.01215.80
7.1.210.0000.01115.48
7.1.200.0030.01015.92
7.1.190.0030.01015.49
7.1.180.0090.00315.58
7.1.170.0080.00015.81
7.1.160.0030.00915.79
7.1.150.0070.00715.94
7.1.140.0060.00615.88
7.1.130.0100.00315.81
7.1.120.0070.00315.75
7.1.110.0100.00315.73
7.1.100.0070.00715.81
7.1.90.0040.01215.82
7.1.80.0030.01015.71
7.1.70.0010.00616.56
7.1.60.0100.01017.63
7.1.50.0080.00916.40
7.1.40.0030.01015.71
7.1.30.0030.01015.70
7.1.20.0050.00515.78
7.1.10.0030.01015.90
7.1.00.0080.03719.12
7.0.330.0030.00615.02
7.0.320.0000.01315.46
7.0.310.0120.00315.20
7.0.300.0070.00315.08
7.0.290.0070.01015.20
7.0.280.0040.00415.15
7.0.270.0060.00615.13
7.0.260.0060.00315.09
7.0.250.0000.00815.48
7.0.240.0030.01015.38
7.0.230.0000.00815.28
7.0.220.0060.00915.05
7.0.210.0000.01115.34
7.0.200.0020.00816.21
7.0.190.0060.00615.52
7.0.180.0060.00615.21
7.0.170.0090.00315.31
7.0.160.0080.00415.54
7.0.150.0000.01215.23
7.0.140.0050.03818.74
7.0.130.0000.01415.56
7.0.120.0040.00415.25
7.0.110.0040.01115.18
7.0.100.0020.02817.49
7.0.90.0060.04417.57
7.0.80.0180.04417.67
7.0.70.0190.04217.72
7.0.60.0220.04017.50
7.0.50.0070.02617.92
7.0.40.0030.04116.72
7.0.30.0080.04816.57
7.0.20.0130.02116.65
7.0.10.0100.02616.63
7.0.00.0050.03316.78
5.6.400.0040.01114.40
5.6.390.0000.01114.32
5.6.380.0070.00714.59
5.6.370.0030.01214.38
5.6.360.0030.00714.69
5.6.350.0030.00614.72
5.6.340.0000.01014.61
5.6.330.0090.00413.90
5.6.320.0030.01114.59
5.6.310.0090.00614.16
5.6.300.0040.01214.25
5.6.290.0070.00714.29
5.6.280.0040.04117.61
5.6.270.0100.00014.32
5.6.260.0040.00414.18
5.6.250.0070.04517.64
5.6.240.0110.04517.51
5.6.230.0090.03317.47
5.6.220.0050.02817.58
5.6.210.0130.03317.67
5.6.200.0150.03617.76
5.6.190.0070.03017.64
5.6.180.0090.03917.53
5.6.170.0070.04517.66
5.6.160.0090.04617.57
5.6.150.0130.03417.62
5.6.140.0070.02317.69
5.6.130.0070.02817.67
5.6.120.0070.04717.75
5.6.110.0070.04517.59
5.6.100.0040.04817.88
5.6.90.0120.03217.64
5.6.80.0070.03217.46
5.6.70.0050.04217.31
5.6.60.0110.02217.35
5.6.50.0050.04017.47
5.6.40.0000.02717.25
5.6.30.0060.02117.34
5.6.20.0060.02617.42
5.6.10.0030.04517.53
5.6.00.0050.02517.22
5.5.380.0100.03817.43
5.5.370.0030.04517.43
5.5.360.0020.03617.52
5.5.350.0000.03417.40
5.5.340.0140.03517.45
5.5.330.0100.02517.40
5.5.320.0080.03517.44
5.5.310.0080.04317.51
5.5.300.0080.04317.66
5.5.290.0040.04717.60
5.5.280.0030.04817.62
5.5.270.0080.04317.56
5.5.260.0060.04317.56
5.5.250.0130.02317.38
5.5.240.0050.04117.31
5.5.230.0050.03117.33
5.5.220.0030.04517.27
5.5.210.0100.03117.12
5.5.200.0140.03817.20
5.5.190.0050.04217.18
5.5.180.0070.02017.24
5.5.170.0080.00014.02
5.5.160.0080.04017.25
5.5.150.0080.03217.33
5.5.140.0070.04217.06
5.5.130.0090.03217.18
5.5.120.0070.03717.17
5.5.110.0050.03417.37
5.5.100.0070.03017.11
5.5.90.0060.03017.23
5.5.80.0100.03717.13
5.5.70.0070.03717.20
5.5.60.0070.03517.35
5.5.50.0030.02817.20
5.5.40.0090.03317.34
5.5.30.0030.03517.07
5.5.20.0050.02417.15
5.5.10.0050.03717.30
5.5.00.0000.02917.16
5.4.450.0070.03615.45
5.4.440.0030.03015.51
5.4.430.0020.02515.56
5.4.420.0080.04515.55
5.4.410.0060.03315.49
5.4.400.0070.03815.40
5.4.390.0050.03015.49
5.4.380.0050.02015.43
5.4.370.0110.03615.43
5.4.360.0070.04415.35
5.4.350.0080.03815.28
5.4.340.0090.01815.28
5.4.330.0030.00311.74
5.4.320.0110.02815.28
5.4.310.0070.02315.39
5.4.300.0000.03415.43
5.4.290.0030.03615.26
5.4.280.0090.03015.38
5.4.270.0050.03715.25
5.4.260.0050.02315.35
5.4.250.0020.03015.27
5.4.240.0020.04015.40
5.4.230.0030.04315.36
5.4.220.0090.03815.34
5.4.210.0070.04115.38
5.4.200.0080.02715.39
5.4.190.0050.03015.33
5.4.180.0030.02215.42
5.4.170.0020.04015.41
5.4.160.0000.02815.41
5.4.150.0050.04015.48
5.4.140.0000.02614.01
5.4.130.0020.02314.03
5.4.120.0050.03214.06
5.4.110.0050.02914.07
5.4.100.0070.02514.00
5.4.90.0140.01613.98
5.4.80.0050.02913.99
5.4.70.0050.04013.97
5.4.60.0050.02614.05
5.4.50.0030.02513.99
5.4.40.0030.02814.07
5.4.30.0070.02313.96
5.4.20.0030.03514.07
5.4.10.0050.03813.98
5.4.00.0050.03713.76
5.3.290.0100.03314.54
5.3.280.0070.06014.50
5.3.270.0000.05014.46
5.3.260.0070.05014.52
5.3.250.0070.04014.42
5.3.240.0100.04314.56
5.3.230.0030.05014.53
5.3.220.0100.07014.53
5.3.210.0130.04014.40
5.3.200.0070.04014.52
5.3.190.0000.06314.55
5.3.180.0000.05314.54
5.3.170.0100.06714.50
5.3.160.0000.04014.38
5.3.150.0070.07714.51
5.3.140.0130.07014.41
5.3.130.0000.04014.50
5.3.120.0100.04714.50
5.3.110.0100.04014.49
5.3.100.0030.06314.02
5.3.90.0070.06713.83
5.3.80.0100.06313.78
5.3.70.0070.04013.95
5.3.60.0100.07013.91
5.3.50.0000.04713.80
5.3.40.0000.04313.80
5.3.30.0030.04313.77
5.3.20.0200.04713.65
5.3.10.0030.03713.61
5.3.00.0030.08013.49
5.2.170.0070.06011.09
5.2.160.0100.03011.19
5.2.150.0000.03711.09
5.2.140.0030.06011.13
5.2.130.0030.04311.09
5.2.120.0070.06010.93
5.2.110.0100.05011.08
5.2.100.0070.03011.12
5.2.90.0030.05011.09
5.2.80.0030.06311.08
5.2.70.0100.05010.97
5.2.60.0100.03011.07
5.2.50.0100.05010.98
5.2.40.0000.03310.95
5.2.30.0070.05310.97
5.2.20.0030.06010.84
5.2.10.0130.04710.87
5.2.00.0000.05010.76
5.1.60.0030.0539.99
5.1.50.0000.05710.05
5.1.40.0030.02710.00
5.1.30.0070.05310.39
5.1.20.0030.03010.40
5.1.10.0070.04310.10
5.1.00.0000.05710.08
5.0.50.0070.0408.53
5.0.40.0030.0208.43
5.0.30.0070.0478.25
5.0.20.0170.0138.22
5.0.10.0000.0308.23
5.0.00.0100.0278.20
4.4.90.0000.0377.95
4.4.80.0000.0377.95
4.4.70.0000.0277.95
4.4.60.0030.0277.95
4.4.50.0070.0307.95
4.4.40.0070.0377.95
4.4.30.0100.0277.95
4.4.20.0030.0337.95
4.4.10.0070.0137.95
4.4.00.0030.0577.95
4.3.110.0030.0177.95
4.3.100.0000.0237.95
4.3.90.0070.0237.95
4.3.80.0070.0237.95
4.3.70.0030.0137.95
4.3.60.0030.0277.95
4.3.50.0000.0207.95
4.3.40.0000.0407.95
4.3.30.0070.0307.95
4.3.20.0000.0207.95
4.3.10.0030.0337.95
4.3.00.0070.0137.95

preferences:
41.39 ms | 400 KiB | 5 Q