3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1, 2, 3, 4, 4, 1, 2, 5, 5, 11, 11); // build and initialize array to track counts $count = array_flip( array_unique( $arr ) ); foreach( $count as $key => $value ) { $count[$key] = 0; } // counting ... foreach ($arr as $key => $value) { $count[$value] += 1; } // result: foreach ( $count as $item => $num ) { if ( $num == 1 ) { echo "$item appears only once.\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.130.0060.00718.86
8.4.120.0110.00918.80
8.4.110.0140.00718.69
8.4.100.0100.00617.85
8.4.90.0090.00920.51
8.4.80.0140.00524.21
8.4.70.0090.00720.52
8.4.60.0110.00820.52
8.4.50.0100.00318.58
8.4.40.0100.01019.59
8.4.30.0130.00619.60
8.4.20.0030.00617.89
8.4.10.0200.00019.43
8.3.260.0050.00516.77
8.3.250.0130.00716.96
8.3.240.0110.00917.00
8.3.230.0120.00716.55
8.3.220.0040.00418.89
8.3.210.0100.01016.81
8.3.200.0050.00416.59
8.3.190.0040.01117.01
8.3.180.0120.00618.93
8.3.170.0060.00317.11
8.3.160.0080.00818.69
8.3.150.0160.00316.99
8.3.140.0000.00816.71
8.3.130.0110.01116.47
8.3.120.0070.00318.71
8.3.110.0040.00420.94
8.3.100.0120.00324.06
8.3.90.0030.00526.77
8.3.80.0060.00318.55
8.3.70.0100.01018.43
8.3.60.0110.00616.50
8.3.50.0120.00718.28
8.3.40.0120.00318.63
8.3.30.0110.00318.71
8.3.20.0150.00020.39
8.3.10.0040.00422.14
8.3.00.0080.00023.65
8.2.290.0120.00717.32
8.2.280.0080.01020.34
8.2.270.0120.00616.64
8.2.260.0110.00417.42
8.2.250.0040.00418.33
8.2.240.0090.00018.99
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0040.01126.77
8.2.200.0070.00416.63
8.2.190.0080.00816.61
8.2.180.0140.00717.96
8.2.170.0110.00422.96
8.2.160.0110.00420.35
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0060.00319.24
8.2.120.0050.00226.35
8.2.110.0070.00421.00
8.2.100.0110.00018.22
8.2.90.0000.00819.17
8.2.80.0050.00317.97
8.2.70.0070.00317.75
8.2.60.0080.00018.16
8.2.50.0030.00618.22
8.2.40.0000.00720.36
8.2.30.0000.00819.30
8.2.20.0030.00518.18
8.2.10.0000.00818.02
8.2.00.0030.00618.11
8.1.330.0100.00916.09
8.1.320.0130.00517.87
8.1.310.0030.00516.53
8.1.300.0040.01416.18
8.1.290.0070.00418.88
8.1.280.0130.00325.92
8.1.270.0050.00322.14
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00724.05
8.1.230.0070.00320.36
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0000.00917.13
8.1.190.0050.00317.36
8.1.180.0000.00718.10
8.1.170.0060.00318.64
8.1.160.0000.00818.76
8.1.150.0040.00420.04
8.1.140.0000.00819.52
8.1.130.0050.00318.96
8.1.120.0080.00017.50
8.1.110.0030.00517.50
8.1.100.0000.01117.52
8.1.90.0000.00717.33
8.1.80.0090.00017.40
8.1.70.0000.00717.46
8.1.60.0030.00617.59
8.1.50.0000.00817.43
8.1.40.0040.00417.48
8.1.30.0040.00417.64
8.1.20.0070.00017.54
8.1.10.0000.00817.55
8.1.00.0030.00617.35
8.0.300.0080.00018.77
8.0.290.0020.00516.75
8.0.280.0030.00318.44
8.0.270.0050.00216.87
8.0.260.0070.00020.14
8.0.250.0070.00017.01
8.0.240.0050.00316.95
8.0.230.0070.00016.88
8.0.220.0000.00816.87
8.0.210.0070.00016.92
8.0.200.0070.00016.90
8.0.190.0080.00016.85
8.0.180.0070.00016.90
8.0.170.0000.00716.93
8.0.160.0040.00416.78
8.0.150.0000.00716.77
8.0.140.0000.00716.85
8.0.130.0030.00313.23
8.0.120.0000.00816.84
8.0.110.0070.00016.88
8.0.100.0040.00416.83
8.0.90.0080.00016.75
8.0.80.0120.01216.91
8.0.70.0030.00316.92
8.0.60.0000.00716.82
8.0.50.0000.00716.89
8.0.30.0100.00917.08
8.0.20.0130.00717.40
8.0.10.0000.00716.89
8.0.00.0060.01216.62
7.4.330.0050.00015.55
7.4.320.0030.00316.57
7.4.300.0040.00416.48
7.4.290.0000.00716.59
7.4.280.0040.00416.52
7.4.270.0030.00316.63
7.4.260.0070.00016.42
7.4.250.0000.00716.48
7.4.240.0000.00716.51
7.4.230.0000.00716.39
7.4.220.0120.01916.48
7.4.210.0120.00816.62
7.4.200.0000.00716.33
7.4.160.0130.00316.46
7.4.150.0120.00917.40
7.4.140.0140.00817.86
7.4.130.0070.01016.58
7.4.120.0130.00716.44
7.4.110.0080.01216.51
7.4.100.0110.01416.51
7.4.90.0090.00916.51
7.4.80.0030.01319.39
7.4.70.0110.00816.40
7.4.60.0150.00316.44
7.4.50.0060.00916.48
7.4.40.0060.01116.54
7.4.30.0090.00616.37
7.4.00.0030.01314.73
7.3.330.0030.00313.23
7.3.320.0030.00313.16
7.3.310.0000.00716.36
7.3.300.0000.00716.23
7.3.290.0100.00416.33
7.3.280.0090.00716.30
7.3.270.0090.00917.40
7.3.260.0130.01316.45
7.3.250.0130.00416.40
7.3.240.0110.00716.34
7.3.230.0060.01316.45
7.3.210.0080.00816.52
7.3.200.0140.00716.66
7.3.190.0120.00316.30
7.3.180.0030.01316.76
7.3.170.0090.01216.32
7.3.160.0080.00916.30
7.3.10.0040.01116.64
7.3.00.0050.00516.71
7.2.330.0090.00916.74
7.2.320.0100.00716.52
7.2.310.0130.01016.49
7.2.300.0130.01016.59
7.2.290.0020.01516.78
7.2.130.0060.00617.01
7.2.120.0030.00817.01
7.2.110.0030.01016.98
7.2.100.0120.00016.95
7.2.90.0000.01016.68
7.2.80.0030.01017.05
7.2.70.0110.00416.80
7.2.60.0050.01116.97
7.2.50.0030.01316.96
7.2.40.0040.01217.00
7.2.30.0040.01116.70
7.2.20.0100.00317.09
7.2.10.0170.00316.93
7.2.00.0070.00716.98
7.1.250.0030.00915.86
7.1.200.0060.00616.00
7.1.90.0050.00818.16
7.1.80.0780.01015.73
7.1.70.0030.00917.26
7.1.60.0170.01035.03
7.1.50.0150.01134.97
7.1.40.0200.00634.45
7.1.30.0100.01734.58
7.1.20.0160.01034.61
7.1.10.0060.01216.49
7.1.00.0060.00816.60
7.0.230.0030.01017.93
7.0.220.0900.00315.87
7.0.210.0040.00916.67
7.0.200.0030.01116.97
7.0.190.0000.01116.55
7.0.180.0060.00616.29
7.0.170.0000.01216.20
7.0.160.0060.00616.30
7.0.150.0070.01116.20
7.0.140.0110.00316.32
7.0.130.0030.01216.29
7.0.120.0030.01016.43
7.0.110.0000.01716.47
7.0.100.0100.00716.38
7.0.90.0090.00916.36
7.0.80.0060.00916.46
7.0.70.0000.01316.54
7.0.60.0080.00416.11
7.0.50.0040.00916.57
7.0.40.0080.01016.70
7.0.30.0040.01316.43
7.0.20.0000.01316.34
7.0.10.0030.01016.29
7.0.00.0050.00916.42
5.6.300.0220.06921.00
5.6.290.0070.05820.84
5.6.280.0100.05520.86
5.6.270.0070.06220.75
5.6.260.0040.06120.86
5.6.250.0070.07720.72
5.6.240.0130.06020.84
5.6.230.0100.06620.92
5.6.220.0070.06920.90
5.6.210.0070.05820.97
5.6.200.0070.06120.80
5.6.190.0190.04720.71
5.6.180.0130.07520.82
5.6.170.0110.05420.93
5.6.160.0160.05120.71
5.6.150.0070.06520.71
5.6.140.0100.06920.74
5.6.130.0030.06620.74
5.6.120.0260.04920.86
5.6.110.0070.05920.85
5.6.100.0070.05920.70
5.6.90.0130.05020.88
5.6.80.0140.04720.20
5.6.70.0030.05820.29
5.6.60.0070.06020.10
5.6.50.0100.07320.10
5.6.40.0190.04420.30
5.6.30.0070.05520.08
5.6.20.0130.05320.18
5.6.10.0100.05120.05
5.6.00.0030.06120.12
5.5.380.0030.06917.42
5.5.370.0180.05517.48
5.5.360.0100.05817.49
5.5.350.0100.05017.39
5.5.340.0140.04817.96
5.5.330.0130.05917.75
5.5.320.0070.07917.90
5.5.310.0070.05717.70
5.5.300.0070.07117.70
5.5.290.0000.06517.75
5.5.280.0070.05917.93
5.5.270.0000.06317.73
5.5.260.0030.06117.89
5.5.250.0070.05517.78
5.5.240.0030.05917.39
5.5.230.0070.05517.15
5.5.220.0060.05417.33
5.5.210.0170.06317.38
5.5.200.0130.04617.32
5.5.190.0100.05217.20
5.5.180.0100.05117.14
5.5.160.0170.04517.12
5.5.150.0170.05517.25
5.5.140.0100.06017.22
5.5.130.0070.05217.32
5.5.120.0070.05217.33
5.5.110.0070.05117.11
5.5.100.0140.04517.09
5.5.90.0090.04717.24
5.5.80.0000.05817.24
5.5.70.0160.04317.04
5.5.60.0100.05417.20
5.5.50.0120.07117.29
5.5.40.0030.05517.23
5.5.30.0030.06617.20
5.5.20.0030.05717.20
5.5.10.0070.05317.17
5.5.00.0160.04616.99
5.4.450.0060.06119.34
5.4.440.0100.05419.41
5.4.430.0100.05719.49
5.4.420.0070.05519.37
5.4.410.0030.05619.36
5.4.400.0060.05719.00
5.4.390.0130.04918.76
5.4.380.0030.07018.98
5.4.370.0120.04718.98
5.4.360.0030.05819.17
5.4.350.0030.05518.98
5.4.340.0100.05018.98
5.4.320.0070.05818.95
5.4.310.0190.05518.85
5.4.300.0030.05519.07
5.4.290.0060.05218.96
5.4.280.0100.05018.76
5.4.270.0080.05019.04
5.4.260.0120.04318.76
5.4.250.0060.05119.04
5.4.240.0030.05518.97
5.4.230.0130.06318.76
5.4.220.0100.05119.07
5.4.210.0130.04619.15
5.4.200.0190.04218.84
5.4.190.0070.05318.99
5.4.180.0030.05518.96
5.4.170.0060.05418.79
5.4.160.0070.06319.07
5.4.150.0100.05018.77
5.4.140.0070.05116.55
5.4.130.0100.04516.47
5.4.120.0100.04516.60
5.4.110.0070.04816.35
5.4.100.0000.05416.48
5.4.90.0060.04816.61
5.4.80.0030.05216.38
5.4.70.0100.04416.53
5.4.60.0070.04816.28
5.4.50.0030.05016.50
5.4.40.0030.05216.58
5.4.30.0030.05516.54
5.4.20.0190.03816.39
5.4.10.0070.07116.32
5.4.00.0100.06515.72
5.3.290.0040.05614.81
5.3.280.0090.05414.58
5.3.270.0130.05014.59
5.3.260.0070.05214.59
5.3.250.0070.04914.60
5.3.240.0070.04814.59
5.3.230.0040.05314.66
5.3.220.0170.05014.66
5.3.210.0100.04714.55
5.3.200.0070.04814.56
5.3.190.0100.06814.66
5.3.180.0060.05214.63
5.3.170.0140.04214.72
5.3.160.0100.04714.73
5.3.150.0030.06314.74
5.3.140.0100.04814.75
5.3.130.0060.05514.54
5.3.120.0030.05614.64
5.3.110.0100.07314.63
5.3.100.0070.07114.18
5.3.90.0160.03914.01
5.3.80.0120.04414.12
5.3.70.0060.05514.00
5.3.60.0100.04914.09
5.3.50.0070.04813.94
5.3.40.0130.04214.14
5.3.30.0030.05013.98
5.3.20.0130.04113.62
5.3.10.0090.04713.58
5.3.00.0030.05313.79
5.2.170.0030.04211.07
5.2.160.0030.04011.25
5.2.150.0070.03911.07
5.2.140.0060.04111.13
5.2.130.0130.03211.21
5.2.120.0030.04011.21
5.2.110.0000.04411.23
5.2.100.0040.05311.11
5.2.90.0150.04411.31
5.2.80.0160.03211.23
5.2.70.0030.04411.23
5.2.60.0100.03611.24
5.2.50.0000.04510.94
5.2.40.0090.03410.92
5.2.30.0070.03910.90
5.2.20.0070.03711.12
5.2.10.0000.04311.08
5.2.00.0190.03710.76
5.1.60.0040.03310.19
5.1.50.0030.03410.27
5.1.40.0120.0259.96
5.1.30.0070.03210.54
5.1.20.0070.03310.55
5.1.10.0030.03610.27
5.1.00.0070.0319.95
5.0.50.0150.0158.43
5.0.40.0040.0268.62
5.0.30.0000.0448.31
5.0.20.0060.0228.08
5.0.10.0040.0268.20
5.0.00.0040.0398.21
4.4.90.0000.0246.43
4.4.80.0000.0246.43
4.4.70.0090.0156.43
4.4.60.0120.0126.43
4.4.50.0000.0246.43
4.4.40.0060.0306.43
4.4.30.0030.0216.43
4.4.20.0000.0256.43
4.4.10.0030.0216.43
4.4.00.0100.0296.43
4.3.110.0100.0146.43
4.3.100.0000.0236.43
4.3.90.0040.0196.43
4.3.80.0000.0356.43
4.3.70.0000.0236.43
4.3.60.0040.0196.43
4.3.50.0000.0256.43
4.3.40.0000.0416.43
4.3.30.0060.0186.43
4.3.20.0000.0256.43
4.3.10.0000.0246.43
4.3.00.0030.0206.43

preferences:
32.19 ms | 403 KiB | 5 Q