3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "First method:\n"; $foodArray = ['Apple' => 'green', 'Banana' => 'yellow']; foreach($foodArray as $color => $fruit) { echo $fruit." - ".$color ." <br />\n"; } echo "\n\nSecond method:\n"; $foodArray = [['name' => 'Apple', 'color' => 'Yellow'], ['name' => 'Banana', 'color' => 'yellow']]; foreach($foodArray as $fruit) { echo $fruit['name']." - ".$fruit['color']." <br />\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)
8.4.120.0100.01123.99
8.4.110.0110.00919.86
8.4.100.0150.00518.88
8.4.90.0070.00418.86
8.4.80.0130.00718.78
8.4.70.0110.00717.74
8.4.60.0110.00918.88
8.4.50.0130.00819.50
8.4.40.0090.00919.28
8.4.30.0090.00017.75
8.4.20.0100.01020.73
8.4.10.0130.00317.83
8.3.250.0080.01118.65
8.3.240.0160.00416.84
8.3.230.0090.00917.06
8.3.220.0050.00319.02
8.3.210.0090.00916.55
8.3.200.0070.00216.56
8.3.190.0140.00416.55
8.3.180.0090.00616.47
8.3.170.0150.00316.61
8.3.160.0120.00616.26
8.3.150.0070.01117.08
8.3.140.0040.00417.30
8.3.130.0080.00016.66
8.3.120.0080.00018.86
8.3.110.0080.00020.94
8.3.100.0070.00024.06
8.3.90.0110.00726.77
8.3.80.0060.00318.43
8.3.70.0090.00916.71
8.3.60.0070.00718.43
8.3.50.0100.00717.29
8.3.40.0060.01218.70
8.3.30.0110.00418.72
8.3.20.0040.00420.90
8.3.10.0000.00821.81
8.3.00.0040.00422.44
8.2.290.0130.00620.40
8.2.280.0130.00918.39
8.2.270.0070.00717.23
8.2.260.0060.00316.76
8.2.250.0100.00016.63
8.2.240.0040.01917.13
8.2.230.0170.00322.58
8.2.220.0060.00337.54
8.2.210.0140.00426.77
8.2.200.0060.00316.50
8.2.190.0100.01016.75
8.2.180.0120.00316.35
8.2.170.0140.00022.96
8.2.160.0070.00721.07
8.2.150.0070.00024.18
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.95
8.2.110.0060.00322.20
8.2.100.0110.00017.86
8.2.90.0040.00418.03
8.2.80.0050.00318.05
8.2.70.0050.00517.93
8.2.60.0080.00018.28
8.2.50.0000.00818.10
8.2.40.0000.00819.47
8.2.30.0070.00019.23
8.2.20.0040.00418.00
8.2.10.0040.00419.29
8.2.00.0000.00718.00
8.1.330.0130.00621.84
8.1.320.0110.00818.59
8.1.310.0090.00618.44
8.1.300.0000.00816.43
8.1.290.0080.00030.84
8.1.280.0140.00725.92
8.1.270.0000.00820.37
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0120.00017.48
8.1.230.0040.00822.53
8.1.220.0040.00417.78
8.1.210.0050.00518.77
8.1.200.0060.00617.23
8.1.190.0060.00317.25
8.1.180.0060.00318.10
8.1.170.0080.00018.37
8.1.160.0070.00018.80
8.1.150.0040.00418.76
8.1.140.0040.00419.05
8.1.130.0000.00717.46
8.1.120.0000.00817.43
8.1.110.0000.00917.50
8.1.100.0000.00717.44
8.1.90.0090.00017.50
8.1.80.0070.00017.42
8.1.70.0030.00317.49
8.1.60.0030.00917.54
8.1.50.0080.00017.55
8.1.40.0090.00017.41
8.1.30.0040.00417.63
8.1.20.0030.00617.61
8.1.10.0000.00817.55
8.1.00.0070.00017.37
8.0.300.0040.00420.03
8.0.290.0000.00816.75
8.0.280.0070.00018.36
8.0.270.0080.00017.25
8.0.260.0030.00316.70
8.0.250.0040.00416.98
8.0.240.0070.00016.92
8.0.230.0060.00316.99
8.0.220.0030.00316.90
8.0.210.0050.00316.90
8.0.200.0030.00317.01
8.0.190.0000.01016.91
8.0.180.0050.00216.92
8.0.170.0000.01016.89
8.0.160.0050.00216.89
8.0.150.0070.00016.82
8.0.140.0030.00416.67
8.0.130.0030.00313.35
8.0.120.0070.00016.88
8.0.110.0040.00416.86
8.0.100.0070.00016.96
8.0.90.0040.00416.71
8.0.80.0020.01216.84
8.0.70.0050.00316.78
8.0.60.0000.00716.78
8.0.50.0040.00416.92
8.0.30.0090.00917.09
8.0.20.0110.01117.10
8.0.10.0070.00016.83
8.0.00.0180.00416.67
7.4.330.0020.00216.79
7.4.320.0000.00616.62
7.4.300.0000.00616.52
7.4.290.0050.00216.57
7.4.280.0000.00716.55
7.4.270.0000.00716.55
7.4.260.0070.00016.35
7.4.250.0000.00716.61
7.4.240.0050.00216.48
7.4.230.0000.00816.35
7.4.220.0000.00716.63
7.4.210.0060.01216.57
7.4.200.0030.00316.30
7.4.160.0060.01016.53
7.4.140.0120.01217.86
7.4.130.0030.01316.47
7.4.120.0090.01216.51
7.4.110.0070.01016.45
7.4.100.0170.00716.63
7.4.90.0040.01416.62
7.4.80.0030.01619.39
7.4.70.0060.01016.47
7.4.60.0080.00816.41
7.4.50.0020.01016.27
7.4.40.0120.00616.47
7.4.00.0070.01114.96
7.3.330.0050.00013.16
7.3.320.0030.00313.00
7.3.310.0070.00016.40
7.3.300.0000.00616.32
7.3.290.0090.00616.30
7.3.280.0100.00816.21
7.3.260.0120.00816.45
7.3.240.0090.00916.47
7.3.230.0100.00716.63
7.3.210.0030.01316.38
7.3.200.0100.00616.65
7.3.190.0060.01016.36
7.3.180.0070.01016.59
7.3.170.0150.00916.50
7.3.160.0130.00316.45
7.3.120.0150.00414.85
7.3.110.0090.00614.77
7.3.100.0040.01614.80
7.3.90.0120.00314.54
7.3.80.0000.01414.91
7.3.70.0090.00914.85
7.3.60.0060.00614.83
7.3.50.0030.01014.80
7.3.40.0080.00414.69
7.3.30.0040.00814.75
7.3.20.9330.00615.56
7.3.10.7400.00515.61
7.3.00.6390.01015.61
7.2.330.0110.00516.43
7.2.320.0030.01416.59
7.2.310.0180.00016.46
7.2.300.0040.01116.57
7.2.290.0070.01016.73
7.2.250.0040.01215.23
7.2.240.0110.00314.85
7.2.230.0030.01014.96
7.2.220.0140.00014.89
7.2.210.0100.01014.99
7.2.200.0060.01214.81
7.2.190.0070.00714.82
7.2.180.0070.00714.90
7.2.170.0030.01014.98
7.2.160.0100.00514.95
7.2.150.9900.00315.66
7.2.140.6880.01215.88
7.2.130.5620.00815.94
7.2.120.4780.00715.77
7.2.110.5700.01015.98
7.2.100.4320.00815.60
7.2.90.5120.01015.90
7.2.80.6050.00815.84
7.2.70.4510.01315.50
7.2.60.4040.00815.80
7.2.50.4380.01015.94
7.2.40.4430.00915.83
7.2.30.4150.00715.73
7.2.20.4550.00715.90
7.2.10.5110.00815.68
7.2.00.4050.01016.12
7.1.330.0140.00015.73
7.1.320.0040.01115.59
7.1.310.0030.01715.93
7.1.300.0030.01015.36
7.1.290.0070.00715.75
7.1.280.0030.00715.52
7.1.270.6830.00714.83
7.1.260.5340.00714.75
7.1.250.5190.00714.74
7.1.240.0000.01415.54
7.1.230.0030.00915.55
7.1.220.0030.01015.60
7.1.210.0060.00915.47
7.1.200.0120.00615.30
7.1.190.0060.00915.21
7.1.180.0060.00615.56
7.1.170.0000.01315.46
7.1.160.0000.01215.61
7.1.150.0000.01315.49
7.1.140.0070.00715.53
7.1.130.0060.00315.61
7.1.120.0060.00615.63
7.1.110.0130.00015.91
7.1.100.0000.00815.85
7.1.90.0000.01115.60
7.1.80.0070.00715.81
7.1.70.0060.00615.82
7.1.60.0120.00315.66
7.1.50.0030.01015.90
7.1.40.0000.01115.52
7.1.30.0110.00415.80
7.1.20.0030.00615.79
7.1.10.0060.00315.55
7.1.00.0000.01115.74

preferences:
96.72 ms | 403 KiB | 5 Q