3v4l.org

run code in 300+ PHP versions simultaneously
<?php $constants = array( 'FOO' => 1, 'BAR' => 2, 'BAZ' => 3, 'FOO2' => 1, 'BAR2' => 2, 'BAZ2' => 3, ); echo 'max+array_count_values: '; $start = microtime(true); for($i=0; $i<1000; $i++) { $bool = (max(array_count_values($constants)) > 1); } $end = microtime(true); echo sprintf('%F', $end-$start) . PHP_EOL; echo 'count+array_unique+count: '; $start = microtime(true); for($i=0; $i<1000; $i++) { $bool = (count($constants) > count(array_unique($constants))); } $end = microtime(true); echo sprintf('%F', $end-$start) . PHP_EOL;

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.0100.00314.88
7.3.120.0120.00914.93
7.3.110.0040.01414.96
7.3.100.0120.00614.64
7.3.90.0050.00514.65
7.3.80.0060.00614.80
7.3.70.0030.01014.75
7.3.60.0090.00614.88
7.3.50.0060.00915.02
7.3.40.0060.00914.71
7.3.30.0110.00414.80
7.3.20.0030.00916.67
7.3.10.0130.00316.41
7.3.00.0120.00316.69
7.2.250.0070.01415.08
7.2.240.0060.01614.96
7.2.230.0080.00515.18
7.2.220.0030.01614.93
7.2.210.0070.00715.15
7.2.200.0100.00315.05
7.2.190.0080.00415.11
7.2.180.0120.00315.11
7.2.170.0060.00914.89
7.2.00.0060.00619.57
7.1.330.0130.00615.71
7.1.320.0100.00315.53
7.1.310.0030.00715.93
7.1.300.0030.01015.55
7.1.290.0030.01015.79
7.1.280.0060.00915.66
7.1.270.0080.00415.75
7.1.260.0060.01015.65
7.1.70.0080.00417.32
7.1.60.0070.01019.27
7.1.50.0090.00316.93
7.1.00.0030.07722.46
7.0.200.0030.00716.73
7.0.140.0100.07022.01
7.0.60.0000.09020.04
7.0.50.0030.06717.91
7.0.40.0000.04720.12
7.0.30.0230.05720.13
7.0.20.0100.05020.02
7.0.10.0170.04720.20
7.0.00.0100.09020.16
5.6.210.0070.04020.75
5.6.200.0030.04718.12
5.6.190.0000.05320.57
5.6.180.0030.08320.60
5.6.170.0170.05320.46
5.6.160.0200.06320.71
5.6.150.0000.06018.18
5.6.140.0000.04718.15
5.6.130.0100.03718.23
5.6.120.0030.08021.02
5.6.110.0070.08720.98
5.6.100.0030.06720.94
5.6.90.0100.05721.10
5.6.80.0100.08020.43
5.6.70.4100.04020.36
5.5.350.0030.07320.38
5.5.340.0000.09718.02
5.5.330.0070.04320.19
5.5.320.0100.07320.28
5.5.310.0400.07020.17
5.5.300.0030.04317.91
5.5.290.0070.09318.02
5.5.280.0100.04020.96
5.5.270.0000.05020.76
5.5.260.0070.04020.67
5.5.250.0130.06320.61
5.5.240.0030.09020.18
5.4.450.1000.04719.41
5.4.440.0930.06319.28
5.4.430.0930.07019.60
5.4.420.1070.05719.51
5.4.410.0870.05018.85
5.4.400.0370.06018.72
5.4.390.0100.06318.49
5.4.380.0200.05318.70
5.4.370.0130.06018.46
5.4.360.0130.07018.65
5.4.350.0200.05718.57
5.4.340.0130.05718.74
5.4.320.0080.03812.45
5.4.310.0080.03912.45
5.4.300.0130.03912.45
5.4.290.0070.04012.45
5.4.280.0060.04812.35
5.4.270.0090.03612.35
5.4.260.0040.04712.35
5.4.250.0030.04412.35
5.4.240.0050.03912.35
5.4.230.0050.04312.34
5.4.220.0060.03812.34
5.4.210.0110.03912.34
5.4.200.0060.05112.34
5.4.190.0340.09512.34
5.4.180.0190.04612.34
5.4.170.0210.04612.36
5.4.160.0220.04812.34
5.4.150.0190.05212.34
5.4.140.0140.05312.03
5.4.130.0430.08712.01
5.4.120.0180.05011.97
5.4.110.0180.04811.97
5.4.100.0190.04911.96
5.4.90.0210.04511.96
5.4.80.0120.05211.96
5.4.70.0310.09411.96
5.4.60.0150.04811.96
5.4.50.0230.03911.96
5.4.40.0150.04611.95
5.4.30.0150.04911.95
5.4.20.0190.04311.95
5.4.10.0220.04411.95
5.4.00.0430.08411.44
5.3.290.0060.04312.80
5.3.280.0110.04912.71
5.3.270.0240.04612.72
5.3.260.0190.05212.72
5.3.250.0200.04912.72
5.3.240.0170.05312.72
5.3.230.0270.04212.70
5.3.220.0340.09312.68
5.3.210.0180.05212.68
5.3.200.0210.04612.68
5.3.190.0190.04712.68
5.3.180.0190.05312.67
5.3.170.0210.04712.67
5.3.160.0150.05012.68
5.3.150.0170.04712.67
5.3.140.0170.04612.66
5.3.130.0140.05012.66
5.3.120.0140.05212.66
5.3.110.0160.05312.66
5.3.100.0190.04712.11
5.3.90.0180.04712.08
5.3.80.0170.04812.08
5.3.70.0200.04412.07
5.3.60.0180.05012.06
5.3.50.0210.04512.00
5.3.40.0190.04712.00
5.3.30.0130.05011.98
5.3.20.0150.04911.75
5.3.10.0110.05111.70
5.3.00.0170.04511.69
5.2.170.0140.0389.20
5.2.160.0170.0369.20
5.2.150.0140.0389.20
5.2.140.0140.0379.20
5.2.130.0150.0369.16
5.2.120.0340.0789.16
5.2.110.0120.0419.16
5.2.100.0180.0339.16
5.2.90.0130.0369.16
5.2.80.0120.0409.15
5.2.70.0140.0389.16
5.2.60.0150.0379.11
5.2.50.0140.0389.07
5.2.40.0140.0399.06
5.2.30.0080.0469.03
5.2.20.0160.0369.02
5.2.10.0110.0448.95
5.2.00.0150.0378.82
5.1.60.0080.0418.10
5.1.50.0100.0408.10
5.1.40.0210.0558.09
5.1.30.0300.0828.43
5.1.20.0120.0378.46
5.1.10.0120.0378.18
5.1.00.0100.0378.18
5.0.50.0080.0326.66
5.0.40.0110.0266.52
5.0.30.0080.0426.33
5.0.20.0080.0306.29
5.0.10.0090.0286.26
5.0.00.0110.0396.26
4.4.90.0030.0294.78
4.4.80.0080.0254.75
4.4.70.0230.0734.75
4.4.60.0080.0294.75
4.4.50.0050.0264.77
4.4.40.0080.0354.70
4.4.30.0070.0264.76
4.4.20.0100.0214.85
4.4.10.0100.0224.84
4.4.00.0070.0374.76
4.3.110.0090.0244.66
4.3.100.0070.0254.67
4.3.90.0090.0224.64
4.3.80.0070.0354.59
4.3.70.0130.0194.63
4.3.60.0050.0274.63
4.3.50.0300.0654.63
4.3.40.0090.0334.54
4.3.30.0060.0293.34
4.3.20.0080.0253.33
4.3.10.0070.0243.29
4.3.00.0030.03015.48

preferences:
35.65 ms | 401 KiB | 5 Q