3v4l.org

run code in 300+ PHP versions simultaneously
<?php function countHashes ($array) { $count = array(); foreach ($array as $val) { $hash = spl_object_hash($val); if (! isset($count[$hash])) { $count[$hash] = 0; } $count[$hash]++; } return $count; }; function checkWhetherSame($array1, $array2) { $count1 = countHashes($array1); $count2 = countHashes($array2); if (count($count1) === count($count2)) { foreach ($count1 as $key => $value) { if ($count2[$key] !== $value) { return false; } } } return true; }; $a = new StdClass(); $b = new StdClass(); $array1 = array($a, $a, $b); $array2 = array($a, $b, $b); var_dump(checkWhetherSame($array1, $array2)); var_dump(checkWhetherSame($array1, $array1)); var_dump(checkWhetherSame($array2, $array2));

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.0130.00716.50
8.3.50.0070.01122.05
8.3.40.0070.00718.78
8.3.30.0090.00919.21
8.3.20.0040.00420.21
8.3.10.0000.00723.70
8.3.00.0080.00022.34
8.2.180.0120.00316.63
8.2.170.0070.00722.96
8.2.160.0070.00720.18
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0000.00822.16
8.2.110.0060.00322.09
8.2.100.0060.00617.78
8.2.90.0050.00219.15
8.2.80.0000.00818.05
8.2.70.0050.00317.63
8.2.60.0030.00618.05
8.2.50.0000.00918.07
8.2.40.0000.00819.27
8.2.30.0080.00018.17
8.2.20.0040.00417.63
8.2.10.0000.00819.52
8.2.00.0050.00317.65
8.1.280.0100.00325.92
8.1.270.0030.00623.73
8.1.260.0040.00426.35
8.1.250.0040.01128.09
8.1.240.0030.00623.91
8.1.230.0080.00318.96
8.1.220.0080.00017.78
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0080.00017.51
8.1.180.0060.00318.10
8.1.170.0040.00418.61
8.1.160.0040.00422.09
8.1.150.0050.00318.66
8.1.140.0040.00417.40
8.1.130.0000.00717.84
8.1.120.0000.00717.51
8.1.110.0040.00417.46
8.1.100.0040.00417.46
8.1.90.0030.00617.51
8.1.80.0030.00317.55
8.1.70.0040.00417.44
8.1.60.0040.00417.65
8.1.50.0030.00517.59
8.1.40.0080.00017.43
8.1.30.0000.00917.69
8.1.20.0030.00617.71
8.1.10.0030.00517.64
8.1.00.0000.00917.39
8.0.300.0070.00018.77
8.0.290.0040.00417.18
8.0.280.0030.00318.49
8.0.270.0000.00817.20
8.0.260.0000.00616.84
8.0.250.0000.00716.98
8.0.240.0000.00816.89
8.0.230.0030.00717.03
8.0.220.0050.00316.93
8.0.210.0030.00316.83
8.0.200.0000.00616.98
8.0.190.0060.00317.04
8.0.180.0040.00416.94
8.0.170.0050.00316.98
8.0.160.0080.00017.00
8.0.150.0000.00716.91
8.0.140.0040.00416.79
8.0.130.0060.00013.42
8.0.120.0030.00516.91
8.0.110.0080.00016.76
8.0.100.0060.00316.74
8.0.90.0080.00016.93
8.0.80.0110.00416.92
8.0.70.0000.00816.96
8.0.60.0000.00716.88
8.0.50.0040.00416.72
8.0.30.0090.01317.21
8.0.20.0140.00717.40
8.0.10.0040.00416.91
8.0.00.0140.00516.81
7.4.330.0030.00315.15
7.4.320.0040.00416.63
7.4.300.0040.00416.52
7.4.290.0070.00016.68
7.4.280.0050.00316.38
7.4.270.0000.00716.46
7.4.260.0000.00613.32
7.4.250.0040.00416.52
7.4.240.0030.00516.62
7.4.230.0030.00316.74
7.4.220.0080.01116.54
7.4.210.0060.01016.53
7.4.200.0000.00716.75
7.4.190.0000.00716.77
7.4.160.0030.01216.43
7.4.150.0100.00717.40
7.4.140.0100.01017.86
7.4.130.0130.00916.59
7.4.120.0120.00516.58
7.4.110.0070.01016.65
7.4.100.0030.01516.38
7.4.90.0090.00916.51
7.4.80.0040.01219.39
7.4.70.0100.00616.54
7.4.60.0150.00616.46
7.4.50.0000.00516.54
7.4.40.0080.00422.77
7.4.30.0090.00616.49
7.4.10.0040.01414.84
7.4.00.0030.01215.04
7.3.330.0030.00313.26
7.3.320.0000.00613.18
7.3.310.0070.00016.44
7.3.300.0000.00716.27
7.3.290.0060.01016.40
7.3.280.0060.01016.38
7.3.270.0060.01117.40
7.3.260.0120.00616.63
7.3.250.0130.00616.48
7.3.240.0140.01016.39
7.3.230.0080.00916.49
7.3.210.0070.01016.52
7.3.200.0120.01219.39
7.3.190.0140.00716.51
7.3.180.0060.01116.56
7.3.170.0090.00616.40
7.3.160.0140.00716.41
7.3.130.0060.00915.02
7.3.120.0040.01414.72
7.3.110.0030.01615.09
7.3.100.0040.01114.88
7.3.90.0060.00914.95
7.3.80.0030.00814.73
7.3.70.0060.00615.00
7.3.60.0040.01215.02
7.3.50.0030.01214.93
7.3.40.0030.00714.78
7.3.30.0000.01414.79
7.3.20.0110.00316.73
7.3.10.0110.00716.56
7.3.00.0140.00316.79
7.2.330.0100.01316.81
7.2.320.0070.01016.60
7.2.310.0120.00616.50
7.2.300.0120.00616.80
7.2.290.0070.01016.89
7.2.260.0040.01415.09
7.2.250.0110.00715.02
7.2.240.0120.00414.90
7.2.230.0040.00815.14
7.2.220.0100.00715.25
7.2.210.0060.00914.84
7.2.200.0040.00714.93
7.2.190.0060.00915.00
7.2.180.0040.00814.99
7.2.170.0040.00815.15
7.2.160.0000.01015.07
7.2.150.0090.00617.09
7.2.140.0000.01517.01
7.2.130.0030.01017.01
7.2.120.0100.00317.07
7.2.110.0080.00816.80
7.2.100.0040.01016.90
7.2.90.0090.00616.87
7.2.80.0080.00816.80
7.2.70.0050.00816.75
7.2.60.0100.00216.95
7.2.50.0040.00417.03
7.2.40.0070.00516.97
7.2.30.0070.00417.07
7.2.20.0070.00617.08
7.2.10.0030.01017.01
7.2.00.0030.00917.69
7.1.330.0090.00615.80
7.1.320.0060.00915.57
7.1.310.0040.01115.93
7.1.300.0030.00615.73
7.1.290.0080.00315.59
7.1.280.0000.01316.04
7.1.270.0070.01015.72
7.1.260.0070.01015.61
7.1.250.0060.00615.77
7.1.240.0060.00615.71
7.1.230.0020.01015.81
7.1.220.0130.00115.63
7.1.210.0040.00715.83
7.1.200.0050.00715.76
7.1.190.0050.00515.82
7.1.180.0040.00715.90
7.1.170.0050.00815.89
7.1.160.0040.00615.74
7.1.150.0060.00615.81
7.1.140.0030.00815.79
7.1.130.0060.00315.74
7.1.120.0050.00815.68
7.1.110.0090.00415.66
7.1.100.0040.00716.55
7.1.90.0030.00715.73
7.1.80.0080.00315.75
7.1.70.0050.00216.34
7.1.60.0010.01517.07
7.1.50.0080.00816.24
7.1.40.0090.00515.90
7.1.30.0050.00915.79
7.1.20.0070.00615.86
7.1.10.0020.00815.67
7.1.00.0080.02718.08
7.0.330.0040.00815.49
7.0.320.0090.00315.07
7.0.310.0050.00815.39
7.0.300.0100.00315.49
7.0.290.0050.00515.27
7.0.280.0040.00815.39
7.0.270.0070.00515.38
7.0.260.0110.00115.32
7.0.250.0060.00415.35
7.0.240.0070.00615.42
7.0.230.0020.00815.58
7.0.220.0070.00415.44
7.0.210.0010.00815.49
7.0.200.0030.00715.88
7.0.190.0030.00815.35
7.0.180.0050.00515.36
7.0.170.0100.00215.52
7.0.160.0030.00515.46
7.0.150.0000.00915.29
7.0.140.0040.03117.72
7.0.130.0050.00615.39
7.0.120.0030.00915.42
7.0.110.0090.00315.43
7.0.100.0190.02916.93
7.0.90.0050.03216.92
7.0.80.0170.02417.00
7.0.70.0040.03316.79
7.0.60.0030.03316.98
7.0.50.0060.02717.05
7.0.40.0040.03315.76
7.0.30.0050.01715.65
7.0.20.0030.03615.61
7.0.10.0050.03215.60
7.0.00.0060.03015.64
5.6.400.0070.01014.43
5.6.390.0090.00614.61
5.6.380.0020.00914.29
5.6.370.0080.00714.46
5.6.360.0020.00914.53
5.6.350.0040.00514.62
5.6.340.0040.00714.59
5.6.330.0070.00614.48
5.6.320.0010.00714.35
5.6.310.0020.01014.44
5.6.300.0030.01014.46
5.6.290.0060.00614.59
5.6.280.0040.03116.65
5.6.270.0080.00314.40
5.6.260.0040.00814.37
5.6.250.0060.02716.51
5.6.240.0040.02316.44
5.6.230.0060.01816.46
5.6.220.0060.02816.42
5.6.210.0080.03016.52
5.6.200.0050.01816.63
5.6.190.0040.03216.66
5.6.180.0050.01716.64
5.6.170.0080.03116.86
5.6.160.0070.01416.67
5.6.150.0080.03016.78
5.6.140.0080.02916.54
5.6.130.0030.02716.57
5.6.120.0090.02716.65
5.6.110.0080.02416.51
5.6.100.0050.03216.54
5.6.90.0050.03216.58
5.6.80.0070.02916.37
5.6.70.0040.03316.59
5.6.60.0090.01916.34
5.6.50.0060.03116.34
5.6.40.0060.02816.30
5.6.30.0060.02716.28
5.6.20.0080.01716.48
5.6.10.0040.03216.42
5.6.00.0050.01816.25
5.5.380.0070.03015.28
5.5.370.0060.02715.39
5.5.360.0040.03415.32
5.5.350.0070.02915.32
5.5.340.0050.02815.47
5.5.330.0080.03115.54
5.5.320.0050.03115.48
5.5.310.0060.03115.70
5.5.300.0050.03315.59
5.5.290.0060.03215.56
5.5.280.0030.03215.58
5.5.270.0090.02815.48
5.5.260.0040.03315.40
5.5.250.0070.02515.30
5.5.240.0080.01715.23
5.5.230.0050.01615.32
5.5.220.0070.02015.10
5.5.210.0080.02515.31
5.5.200.0070.01815.26
5.5.190.0070.03515.26
5.5.180.0100.02915.39
5.5.170.0000.01214.18
5.5.160.0040.02015.20
5.5.150.0060.03115.26
5.5.140.0030.02315.29
5.5.130.0070.03115.10
5.5.120.0080.02415.26
5.5.110.0040.03115.24
5.5.100.0070.03115.02
5.5.90.0030.02615.16
5.5.80.0040.02915.22
5.5.70.0070.02415.19
5.5.60.0050.01615.30
5.5.50.0020.02015.21
5.5.40.0060.01615.15
5.5.30.0020.01915.28
5.5.20.0090.01415.02
5.5.10.0010.02115.20
5.5.00.0060.01715.20
5.4.450.0040.02713.78
5.4.440.0050.01813.82
5.4.430.0040.01913.97
5.4.420.0060.02013.93
5.4.410.0080.02313.84
5.4.400.0050.02313.73
5.4.390.0060.02213.65
5.4.380.0030.03013.88
5.4.370.0030.02413.83
5.4.360.0050.02313.71
5.4.350.0050.01913.77
5.4.340.0060.02913.74
5.4.330.0030.00611.16
5.4.320.0040.03113.84
5.4.310.0090.02313.66
5.4.300.0030.02013.70
5.4.290.0050.02313.87
5.4.280.0050.02813.82
5.4.270.0070.02913.70
5.4.260.0060.02613.80
5.4.250.0040.02413.94
5.4.240.0000.02013.75
5.4.230.0050.02113.70
5.4.220.0030.01913.86
5.4.210.0040.01613.78
5.4.200.0080.01313.83
5.4.190.0050.01613.53
5.4.180.0020.02013.77
5.4.170.0010.01813.70
5.4.160.0050.01413.93
5.4.150.0050.01713.82
5.4.140.0060.01212.90
5.4.130.0050.01612.83
5.4.120.0010.01912.98
5.4.110.0060.01612.85
5.4.100.0030.01612.90
5.4.90.0050.01612.92
5.4.80.0060.01312.94
5.4.70.0050.01312.88
5.4.60.0030.01412.81
5.4.50.0080.01312.95
5.4.40.0050.01412.95
5.4.30.0030.01712.89
5.4.20.0080.01212.76
5.4.10.0030.01612.87
5.4.00.0060.01212.62
5.3.290.0070.01612.05
5.3.280.0040.01711.90
5.3.270.0030.01712.06
5.3.260.0050.01512.03
5.3.250.0030.01712.01
5.3.240.0020.01312.01
5.3.230.0030.01311.95
5.3.220.0060.01311.89
5.3.210.0080.01211.97
5.3.200.0030.01511.94
5.3.190.0040.01711.99
5.3.180.0040.01512.02
5.3.170.0030.01512.11
5.3.160.0020.01512.00
5.3.150.0030.01711.91
5.3.140.0050.01712.09
5.3.130.0050.01411.99
5.3.120.0040.01711.99
5.3.110.0030.01712.01
5.3.100.0010.01811.87
5.3.90.0020.01511.88
5.3.80.0030.01811.80
5.3.70.0040.01511.76
5.3.60.0030.02411.82
5.3.50.0020.01411.81
5.3.40.0020.01711.82
5.3.30.0050.01411.76
5.3.20.0040.01611.75
5.3.10.0010.01711.67
5.3.00.0050.01511.54
5.2.170.0050.01510.40
5.2.160.0050.01510.35
5.2.150.0010.01810.39
5.2.140.0050.01810.29
5.2.130.0030.01810.35
5.2.120.0020.03110.22
5.2.110.0030.03310.19
5.2.100.0030.02110.45
5.2.90.0030.01910.30
5.2.80.0020.01710.14
5.2.70.0000.01910.26
5.2.60.0020.02010.21
5.2.50.0040.01710.18
5.2.40.0000.01810.34
5.2.30.0040.01310.16
5.2.20.0010.01610.16
5.2.10.0020.01710.08
5.2.00.0040.01510.04
5.1.60.0020.0139.67
5.1.50.0020.0169.69
5.1.40.0050.0129.63
5.1.30.0030.0259.87
5.1.20.0030.0329.85
5.1.10.0030.0289.70
5.1.00.0050.0229.68
5.0.50.0020.0188.83
5.0.40.0020.0258.87
5.0.30.0020.0318.74
5.0.20.0050.0228.66
5.0.10.0010.0188.74
5.0.00.0020.0348.64
4.4.90.0020.0088.27
4.4.80.0020.0088.27
4.4.70.0020.0088.27
4.4.60.0010.0108.27
4.4.50.0010.0108.27
4.4.40.0000.0158.27
4.4.30.0030.0108.27
4.4.20.0020.0188.27
4.4.10.0030.0188.27
4.4.00.0020.0278.27
4.3.110.0080.0158.27
4.3.100.0020.0198.27
4.3.90.0030.0188.27
4.3.80.0000.0188.27
4.3.70.0020.0138.27
4.3.60.0070.0158.27
4.3.50.0050.0168.27
4.3.40.0020.0238.27
4.3.30.0030.0188.27
4.3.20.0030.0158.27
4.3.10.0020.0208.27
4.3.00.0030.0188.27

preferences:
50.95 ms | 400 KiB | 5 Q