3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numeric_fails = 0; $non_numeric_fails = 0; $iterations = 1000; $results = array(); for ($i = 0; $i < $iterations; $i++) { $my_key = uniqid("\x00"); $var = array(); $var[$my_key] = TRUE; foreach ($var as $key => $val) { if ($key === $my_key) { if (is_numeric($my_key)) { $results['Numeric Equal'] = TRUE; } else { $results['Non-numeric Equal'] = TRUE; } } else { if (is_numeric($my_key)) { $results['Numeric Fail'] = TRUE; } else { $results['Non-numeric Fail'] = TRUE; } } } } var_dump($results);

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.00.0080.01115.05
7.3.120.0070.01015.05
7.3.110.0030.01314.82
7.3.100.0100.01014.72
7.3.90.0060.01015.01
7.3.80.0070.00714.84
7.3.70.0060.00314.99
7.3.60.0000.01014.63
7.3.50.0160.00014.55
7.3.40.0080.00414.81
7.3.30.0100.00414.74
7.3.20.0000.01416.88
7.3.10.0090.00616.80
7.3.00.0070.00716.46
7.2.250.0030.01715.07
7.2.240.0030.01615.17
7.2.230.0110.00815.14
7.2.220.0030.01015.16
7.2.210.0030.00915.07
7.2.200.0100.00615.16
7.2.190.0030.01315.03
7.2.180.0060.01215.16
7.2.170.0100.01015.07
7.2.00.0040.01419.57
7.1.330.0120.01215.89
7.1.320.0070.01515.83
7.1.310.0060.00915.54
7.1.300.0060.01515.80
7.1.290.0120.00415.84
7.1.280.0160.00515.86
7.1.270.0040.01615.51
7.1.260.0080.01315.88
7.1.70.0030.01717.19
7.1.60.0090.00919.61
7.1.50.0160.01317.05
7.1.00.0100.07722.48
7.0.200.0040.00816.81
7.0.140.0130.07022.18
7.0.60.0000.08721.75
7.0.50.0070.06017.82
7.0.40.0100.04020.12
7.0.30.0270.09320.09
7.0.20.0270.04320.12
7.0.10.0030.06320.02
7.0.00.0170.07720.08
5.6.280.0100.07720.81
5.6.210.0070.04720.59
5.6.200.0100.06018.11
5.6.190.0070.04720.27
5.6.180.0370.07020.62
5.6.170.0230.04020.48
5.6.160.0100.09020.40
5.6.150.0030.07018.09
5.6.140.0070.08718.11
5.6.130.0100.05718.15
5.6.120.0100.08721.01
5.6.110.0070.07721.02
5.6.100.0030.08321.03
5.6.90.0130.07720.98
5.6.80.0100.08020.28
5.5.350.0100.06720.40
5.5.340.0070.08718.02
5.5.330.0130.06020.21
5.5.320.0430.06720.29
5.5.310.0370.07320.14
5.5.300.0130.07717.91
5.5.290.0070.04717.96
5.5.280.0170.08720.96
5.5.270.0270.07020.84
5.5.260.0100.08720.79
5.5.250.0030.08720.57
5.5.240.0230.04720.23
5.4.450.0330.05319.57
5.4.440.0170.04719.41
5.4.430.0500.04019.40
5.4.420.0100.05019.25
5.4.410.0400.04018.97
5.4.400.0470.03719.24
5.4.390.0130.05319.09
5.4.380.0530.05718.50
5.4.370.0470.08018.50
5.4.360.0570.07018.67
5.4.350.0370.07718.67
5.4.340.0430.07318.67
5.4.320.0110.04612.45
5.4.310.0100.04412.45
5.4.300.0150.03812.46
5.4.290.0110.04512.45
5.4.280.0120.04012.35
5.4.270.0160.03812.35
5.4.260.0160.06012.35
5.4.250.0160.06012.35
5.4.240.0190.04912.35
5.4.230.0170.05812.34
5.4.220.0190.04812.34
5.4.210.0190.05612.34
5.4.200.0130.05112.34
5.4.190.0110.04812.34
5.4.180.0150.04512.34
5.4.170.0080.04512.35
5.4.160.0090.04612.35
5.4.150.0120.04012.34
5.4.140.0060.04612.03
5.4.130.0090.05112.02
5.4.120.0120.05011.97
5.4.110.0100.04911.97
5.4.100.0120.04111.96
5.4.90.0130.05011.97
5.4.80.0100.05111.96
5.4.70.0100.04411.96
5.4.60.0080.05011.96
5.4.50.0090.05811.96
5.4.40.0190.05311.95
5.4.30.0150.04711.95
5.4.20.0130.05211.95
5.4.10.0170.03811.95
5.4.00.0130.04311.44
5.3.290.0120.04712.80
5.3.280.0100.04612.71
5.3.270.0100.05512.72
5.3.260.0130.06112.72
5.3.250.0140.06112.72
5.3.240.0130.05812.72
5.3.230.0170.06612.71
5.3.220.0140.04612.68
5.3.210.0110.05812.68
5.3.200.0160.06712.68
5.3.190.0170.05212.68
5.3.180.0150.05212.67
5.3.170.0190.05112.67
5.3.160.0180.06312.67
5.3.150.0150.04912.67
5.3.140.0200.05112.66
5.3.130.0150.06412.66
5.3.120.0100.04712.66
5.3.110.0080.04912.66
5.3.100.0060.04912.12
5.3.90.0080.04612.08
5.3.80.0090.04512.07
5.3.70.0100.04512.07
5.3.60.0050.04812.07
5.3.50.0130.04212.00
5.3.40.0130.04412.00
5.3.30.0130.04311.95
5.3.20.0100.04611.73
5.3.10.0130.04211.69
5.3.00.0080.05211.68
5.2.170.0100.0399.19
5.2.160.0110.0449.19
5.2.150.0040.0459.18
5.2.140.0100.0399.18
5.2.130.0080.0389.14
5.2.120.0140.0329.14
5.2.110.0130.0399.14
5.2.100.0070.0409.14
5.2.90.0120.0399.14
5.2.80.0100.0379.14
5.2.70.0070.0539.14
5.2.60.0170.0389.09
5.2.50.0130.0359.06
5.2.40.0120.0379.04
5.2.30.0070.0439.02
5.2.20.0080.0389.00
5.2.10.0080.0368.93
5.2.00.0100.0388.78
5.1.60.0110.0428.07
5.1.50.0100.0328.06
5.1.40.0030.0398.04
5.1.30.0130.0338.40
5.1.20.0110.0348.42
5.1.10.0100.0348.14
5.1.00.0090.0368.15
5.0.50.0090.0336.63
5.0.40.0070.0316.49
5.0.30.0060.0426.31
5.0.20.0040.0416.30
5.0.10.0100.0296.27
5.0.00.0060.0466.27
4.4.90.0130.0274.77
4.4.80.0100.0244.75
4.4.70.0070.0354.75
4.4.60.0060.0264.75
4.4.50.0090.0224.77
4.4.40.0080.0364.71
4.4.30.0060.0304.76
4.4.20.0150.0274.85
4.4.10.0140.0254.84
4.4.00.0120.0334.76
4.3.110.0040.0324.66
4.3.100.0050.0264.66
4.3.90.0100.0274.64
4.3.80.0090.0384.58
4.3.70.0050.0264.63
4.3.60.0080.0244.63
4.3.50.0110.0284.63
4.3.40.0040.0424.54
4.3.30.0040.0333.34
4.3.20.0060.0273.32
4.3.10.0060.0293.28
4.3.00.0030.02713.95

preferences:
33.04 ms | 400 KiB | 5 Q