3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keys = ['1', '6', 4, '8', 'f', 200, '-1']; $one = []; foreach ($keys as $k) { $one[$k] = 'set'; } $two = []; foreach ($keys as $k) { $two[(int)$k] = 'set'; } var_dump($one, $two);

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.20.0100.01019.38
8.4.10.0030.00619.58
8.3.150.0130.00617.12
8.3.140.0150.00016.68
8.3.130.0000.01018.51
8.3.120.0120.00420.57
8.3.110.0080.00020.94
8.3.100.0100.01024.06
8.3.90.0030.00526.77
8.3.80.0060.00318.30
8.3.70.0130.00718.15
8.3.60.0060.01316.50
8.3.50.0130.01221.16
8.3.40.0130.00618.76
8.3.30.0070.00718.75
8.3.20.0040.00420.45
8.3.10.0050.00321.89
8.3.00.0040.00420.84
8.2.270.0060.01216.54
8.2.260.0100.01018.74
8.2.250.0050.00316.69
8.2.240.0090.00317.10
8.2.230.0140.00322.58
8.2.220.0110.00737.54
8.2.210.0140.00626.77
8.2.200.0060.00318.54
8.2.190.0040.01816.63
8.2.180.0140.00716.75
8.2.170.0090.00922.96
8.2.160.0070.00720.38
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00020.94
8.2.120.0040.00426.35
8.2.110.0080.00321.04
8.2.100.0080.00417.85
8.2.90.0000.00818.16
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0040.00417.93
8.2.50.0050.00318.10
8.2.40.0050.00320.61
8.2.30.0000.00719.23
8.2.20.0030.00518.11
8.2.10.0050.00218.16
8.2.00.0040.00417.80
8.1.310.0070.00716.63
8.1.300.0090.00018.44
8.1.290.0040.00430.84
8.1.280.0100.00725.92
8.1.270.0040.00422.19
8.1.260.0000.00728.09
8.1.250.0000.00728.09
8.1.240.0060.00322.20
8.1.230.0000.01120.93
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0090.00017.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0080.00018.96
8.1.160.0040.00418.89
8.1.150.0040.00421.98
8.1.140.0030.00519.54
8.1.130.0050.00317.39
8.1.120.0040.00417.54
8.1.110.0060.00317.32
8.1.100.0070.00017.38
8.1.90.0030.00517.34
8.1.80.0040.00417.46
8.1.70.0040.00417.45
8.1.60.0000.00817.55
8.1.50.0040.00717.42
8.1.40.0030.00517.47
8.1.30.0080.00017.62
8.1.20.0040.00417.61
8.1.10.0030.00517.37
8.1.00.0000.00817.45
8.0.300.0040.00422.06
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0040.00417.16
8.0.260.0060.00016.81
8.0.250.0000.00616.88
8.0.240.0000.00716.93
8.0.230.0030.00316.90
8.0.220.0040.00416.80
8.0.210.0000.00716.80
8.0.200.0000.00716.91
8.0.190.0080.00016.93
8.0.180.0000.00816.88
8.0.170.0030.00516.91
8.0.160.0040.00416.80
8.0.150.0000.00816.82
8.0.140.0030.00316.89
8.0.130.0050.00013.35
8.0.120.0070.00016.82
8.0.110.0040.00416.92
8.0.100.0070.00016.76
8.0.90.0040.00416.80
8.0.80.0110.00416.84
8.0.70.0050.00216.84
8.0.60.0040.00416.86
8.0.50.0040.00416.79
8.0.30.0080.00917.29
8.0.20.0100.01217.40
8.0.10.0040.00416.89
8.0.00.0080.01116.70
7.4.330.0050.00015.55
7.4.320.0040.00416.63
7.4.300.0070.00016.50
7.4.290.0050.00316.40
7.4.280.0000.00716.58
7.4.270.0070.00016.64
7.4.260.0030.00316.63
7.4.250.0000.00816.61
7.4.240.0030.00316.41
7.4.230.0070.00016.60
7.4.220.0060.00916.48
7.4.210.0090.00616.52
7.4.200.0000.00716.53
7.4.160.0120.00416.51
7.4.150.0060.01117.40
7.4.140.0070.01117.86
7.4.130.0110.00816.51
7.4.120.0080.01216.54
7.4.110.0170.00016.65
7.4.100.0170.00016.48
7.4.90.0090.01016.45
7.4.80.0090.01019.39
7.4.70.0040.01316.56
7.4.60.0130.00316.49
7.4.50.0090.00616.38
7.4.40.0060.01116.60
7.4.30.0030.01316.42
7.4.00.0070.01014.81
7.3.330.0030.00313.20
7.3.320.0030.00313.16
7.3.310.0050.00316.29
7.3.300.0030.00316.37
7.3.290.0110.00416.31
7.3.280.0100.00916.37
7.3.270.0120.00617.40
7.3.260.0090.00916.53
7.3.250.0120.00916.41
7.3.240.0120.00716.38
7.3.230.0090.00916.39
7.3.210.0110.00616.41
7.3.200.0120.00616.41
7.3.190.0060.01216.50
7.3.180.0120.00316.30
7.3.170.0160.00716.45
7.3.160.0140.00316.38
7.3.120.0060.00915.01
7.3.110.0100.01014.45
7.3.100.0110.00415.04
7.3.90.0060.01014.81
7.3.80.0090.00614.98
7.3.70.0040.01114.79
7.3.60.0060.00915.00
7.3.50.0090.00915.04
7.3.40.0030.01014.75
7.3.30.0080.00814.76
7.3.20.0070.00716.71
7.3.10.0040.00816.50
7.3.00.0000.01316.85
7.2.330.0100.00616.71
7.2.320.0000.01716.61
7.2.310.0150.00416.53
7.2.300.0090.00916.38
7.2.290.0130.00316.59
7.2.240.0130.00614.72
7.2.230.0040.01214.96
7.2.220.0040.00714.69
7.2.210.0100.00315.20
7.2.200.0000.01214.89
7.2.190.0060.00915.13
7.2.180.0060.00914.92
7.2.170.0070.00815.12
7.2.160.0100.00315.14
7.2.150.0070.00716.85
7.2.140.0070.00716.95
7.2.130.0030.01416.68
7.2.120.0000.01116.97
7.2.110.0030.00916.93
7.2.100.0060.00616.89
7.2.90.0030.01016.98
7.2.80.0100.00716.92
7.2.70.0030.01217.05
7.2.60.0110.00416.88
7.2.50.0040.00816.69
7.2.40.0080.00816.92
7.2.30.0030.01016.96
7.2.20.0000.01316.90
7.2.10.0030.00716.73
7.2.00.0040.01118.13
7.1.330.0070.01115.63
7.1.320.0060.00615.65
7.1.310.0030.01015.77
7.1.300.0060.01215.87
7.1.290.0060.00715.81
7.1.280.0100.00015.91
7.1.270.0100.00315.73
7.1.260.0000.01415.89
7.1.250.0120.00315.96
7.1.70.0000.00717.19
7.1.60.0070.00717.29
7.1.00.0070.07022.33
7.0.200.0170.00714.96
7.0.130.0070.05722.05
7.0.120.0130.05022.05
7.0.110.0030.06322.03
7.0.100.0130.05722.10
7.0.90.0100.06321.98
7.0.80.0130.05322.07
7.0.70.0100.05022.11
7.0.60.0100.06022.11
7.0.50.0030.06021.99
7.0.40.0200.04722.12
7.0.30.0070.05322.12
7.0.20.0100.05022.02
7.0.10.0030.05322.14
7.0.00.0100.05022.11
5.6.280.0070.06020.80
5.6.270.0100.05720.78
5.6.260.0030.06020.88
5.6.250.0170.05021.04
5.6.240.0130.05320.80
5.6.230.0070.06320.93
5.6.220.0100.05720.91
5.6.210.0130.05020.87
5.6.200.0070.06020.80
5.6.190.0000.06321.02
5.6.180.0030.05721.04
5.6.170.0000.06020.82
5.6.160.0070.05320.87
5.6.150.0130.04720.87
5.6.140.0030.06020.87
5.6.130.0100.05720.86
5.6.120.0100.07320.74
5.6.110.0100.06021.02
5.6.100.0030.07020.84
5.6.90.0100.05320.73
5.6.80.0130.04720.15
5.6.70.0070.05320.21
5.6.60.0070.05720.20
5.6.50.0070.05320.32
5.6.40.0030.05720.30
5.6.30.0070.05720.12
5.6.20.0100.05020.15
5.6.10.0030.06020.13
5.6.00.0100.05720.44

preferences:
27.86 ms | 403 KiB | 5 Q