3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['1','a','b','c']; echo "$array[2]". "\n"; echo $array [4]= 'd'."\n"; echo $array[]='f'."\n"; //aasocoative array $grosery=['chocolate'=>1, 'sugar'=>10, 'salt'=>3, 'apple'=>2, 'mango'=>5]; // ['1','a','b','c'], this isn't any differnt from the one on the left foreach($array as $key=>$thing) { echo $key . ' ' . $thing. "\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.3.60.0120.00616.88
8.3.50.0110.00716.37
8.3.40.0190.00318.84
8.3.30.0090.00618.75
8.3.20.0080.00020.29
8.3.10.0080.00023.65
8.3.00.0030.00722.09
8.2.180.0030.01718.16
8.2.170.0040.01122.96
8.2.160.0100.00319.04
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00021.04
8.2.120.0070.00026.35
8.2.110.0000.01022.32
8.2.100.0040.00819.64
8.2.90.0040.00419.23
8.2.80.0040.00417.97
8.2.70.0050.00517.38
8.2.60.0000.00817.93
8.2.50.0060.00318.10
8.2.40.0070.00020.59
8.2.30.0050.00219.37
8.2.20.0000.00718.13
8.2.10.0030.00518.11
8.2.00.0040.00418.18
8.1.280.0060.00925.92
8.1.270.0120.00322.05
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0100.00020.99
8.1.230.0070.00419.15
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0100.00317.25
8.1.190.0050.00317.25
8.1.180.0000.00818.10
8.1.170.0000.00818.56
8.1.160.0000.00719.12
8.1.150.0040.00420.67
8.1.140.0040.00419.63
8.1.130.0030.00318.80
8.1.120.0070.00017.51
8.1.110.0050.00317.41
8.1.100.0040.00417.36
8.1.90.0000.00817.31
8.1.80.0030.00317.46
8.1.70.0030.00317.48
8.1.60.0050.00317.58
8.1.50.0080.00017.50
8.1.40.0070.00017.38
8.1.30.0040.00417.65
8.1.20.0070.00017.65
8.1.10.0030.00617.59
8.1.00.0000.00817.50
8.0.300.0040.00420.02
8.0.290.0000.00716.63
8.0.280.0040.00418.32
8.0.270.0000.00717.16
8.0.260.0030.00316.93
8.0.250.0000.00616.99
8.0.240.0070.00016.84
8.0.230.0070.00017.02
8.0.220.0000.00716.81
8.0.210.0000.00916.96
8.0.200.0000.00716.86
8.0.190.0000.00816.95
8.0.180.0030.00616.93
8.0.170.0050.00316.75
8.0.160.0030.00316.90
8.0.150.0000.00716.72
8.0.140.0000.00716.74
8.0.130.0060.00013.30
8.0.120.0000.00716.79
8.0.110.0040.00416.84
8.0.100.0040.00416.88
8.0.90.0000.00716.89
8.0.80.0090.01216.91
8.0.70.0000.00816.85
8.0.60.0050.00316.86
8.0.50.0030.00516.93
8.0.30.0120.00516.91
8.0.20.0080.01017.40
8.0.10.0030.00516.92
8.0.00.0140.00416.64
7.4.330.0000.00615.55
7.4.320.0040.00416.50
7.4.300.0000.00616.41
7.4.290.0030.00616.52
7.4.280.0090.00016.48
7.4.270.0030.00516.57
7.4.260.0050.00013.33
7.4.250.0050.00316.52
7.4.240.0070.00016.52
7.4.230.0040.00416.34
7.4.220.0100.00716.67
7.4.210.0030.01716.62
7.4.200.0030.00316.58
7.4.160.0090.00916.55
7.4.150.0170.00017.40
7.4.140.0080.00917.86
7.4.130.0130.00816.67
7.4.120.0090.00916.49
7.4.110.0070.01116.60
7.4.100.0100.00716.62
7.4.90.0120.00916.57
7.4.80.0060.01019.39
7.4.70.0060.01016.53
7.4.60.0030.01216.47
7.4.50.0000.00916.34
7.4.40.0060.01316.34
7.4.30.0030.01316.53
7.4.10.0100.01014.88
7.4.00.0080.01014.92
7.3.330.0040.00413.16
7.3.320.0030.00313.08
7.3.310.0000.00716.34
7.3.300.0040.00416.29
7.3.290.0050.00916.33
7.3.280.0080.00716.33
7.3.270.0130.03317.40
7.3.260.0070.01016.28
7.3.250.0120.00616.50
7.3.240.0100.01016.45
7.3.230.0060.01216.52
7.3.210.0110.00716.23
7.3.200.0100.00716.44
7.3.190.0180.00016.56
7.3.180.0160.00016.32
7.3.170.0000.01716.39
7.3.160.0090.01416.43
7.3.130.0090.00914.70
7.3.120.0060.01015.01
7.3.110.0070.01014.91
7.3.100.0050.00814.79
7.3.90.0020.00914.77
7.3.80.0060.00614.78
7.3.70.0030.00914.79
7.3.60.0020.01114.70
7.3.50.0050.00514.83
7.3.40.0050.00914.94
7.3.30.0060.00614.64
7.3.20.0070.00716.73
7.3.10.0030.01016.63
7.3.00.0080.00616.88
7.2.330.0030.01416.56
7.2.320.0090.00916.66
7.2.310.0060.01216.48
7.2.300.0070.01416.63
7.2.290.0100.01016.57
7.2.260.0090.00915.04
7.2.250.0090.01015.14
7.2.240.0080.00614.95
7.2.230.0110.00415.04
7.2.220.0060.00615.26
7.2.210.0080.00815.05
7.2.200.0100.00515.03
7.2.190.0040.00915.13
7.2.180.0080.00614.95
7.2.170.0010.01215.03
7.2.160.0060.00315.07
7.2.150.0030.00716.72
7.2.140.0070.00716.60
7.2.130.0070.01016.90
7.2.120.0090.00317.09
7.2.110.0090.00617.02
7.2.100.0000.00916.78
7.2.90.0080.00816.92
7.2.80.0060.00317.21
7.2.70.0000.01817.11
7.2.60.0120.00216.87
7.2.50.0060.00917.08
7.2.40.0090.00617.05
7.2.30.0030.01417.04
7.2.20.0160.00316.71
7.2.10.0070.00716.76
7.2.00.0050.01018.04
7.1.330.0090.00515.57
7.1.320.0050.00715.75
7.1.310.0060.00815.93
7.1.300.0060.00615.83
7.1.290.0060.00515.85
7.1.280.0020.01315.71
7.1.270.0040.00515.77
7.1.260.0040.00915.90
7.1.250.0000.01415.92
7.1.240.0120.00015.84
7.1.230.0110.00415.66
7.1.220.0070.00715.87
7.1.210.0060.00615.88
7.1.200.0050.00815.79
7.1.190.0000.01515.95
7.1.180.0060.00615.87
7.1.170.0030.01015.76
7.1.160.0070.01016.02
7.1.150.0080.00615.65
7.1.140.0060.00915.87
7.1.130.0130.00315.87
7.1.120.0060.00615.86
7.1.110.0060.01015.73
7.1.100.0070.00716.79
7.1.90.0100.00315.50
7.1.80.0070.00315.85
7.1.70.0060.00916.30
7.1.60.0160.01325.43
7.1.50.0140.01225.35
7.1.40.0210.00625.10
7.1.30.0150.01325.23
7.1.20.0190.01125.25
7.1.10.0030.01316.21
7.1.00.0070.00816.27
7.0.330.0090.00315.27
7.0.320.0030.00615.40
7.0.310.0030.01015.57
7.0.300.0040.01115.32
7.0.290.0060.00615.29
7.0.280.0130.00015.48
7.0.270.0090.00615.22
7.0.260.0050.00515.44
7.0.250.0060.00615.61
7.0.240.0070.00715.61
7.0.230.0040.00815.39
7.0.220.0040.00815.14
7.0.210.0030.01015.51
7.0.200.0020.01316.03
7.0.190.0080.00516.21
7.0.180.0050.01215.92
7.0.170.0100.00615.78
7.0.160.0080.00715.91
7.0.150.0060.01015.68
7.0.140.0070.00915.96
7.0.130.0050.00815.89
7.0.120.0050.01315.98
7.0.110.0100.00815.97
7.0.100.0110.00815.83
7.0.90.0080.00715.84
7.0.80.0050.01215.97
7.0.70.0060.00815.86
7.0.60.0080.00915.79
7.0.50.0080.00815.89
7.0.40.0080.00614.92
7.0.30.0060.00715.03
7.0.20.0090.00714.93
7.0.10.0060.01015.02
7.0.00.0050.00814.88
5.6.400.0100.00614.64
5.6.390.0060.00314.36
5.6.380.0060.00614.61
5.6.370.0030.01014.43
5.6.360.0070.01014.75
5.6.350.0040.00714.39
5.6.340.0070.01114.52
5.6.330.0140.00414.61
5.6.320.0120.00314.27
5.6.310.0070.00714.74
5.6.300.0040.00814.24
5.6.290.0040.00714.43
5.6.280.0040.00814.54
5.6.270.0030.01014.57
5.6.260.0040.00414.46
5.6.250.0070.01014.30
5.6.240.0070.00314.48
5.6.230.0000.01614.57
5.6.220.0030.00714.46
5.6.210.0070.00714.18
5.6.200.0120.00314.33
5.6.190.0080.00614.48
5.6.180.0000.01214.79
5.6.170.0040.01114.59
5.6.160.0030.01014.33
5.6.150.0060.00614.30
5.6.140.0110.00014.65
5.6.130.0070.00414.54
5.6.120.0070.01014.57
5.6.110.0030.01114.33
5.6.100.0030.01214.22
5.6.90.0060.00614.42
5.6.80.0030.01014.36
5.6.70.0070.00714.33
5.6.60.0000.00914.39
5.6.50.0060.00314.21
5.6.40.0000.01114.11
5.6.30.0060.00613.98
5.6.20.0110.00314.63
5.6.10.0070.00414.38
5.6.00.0100.00314.12

preferences:
42.64 ms | 400 KiB | 5 Q