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); $array2 = array($a, $b, $b, $b); var_dump(checkWhetherSame($array1, $array2)); var_dump(checkWhetherSame($array1, $array1)); var_dump(checkWhetherSame($array2, $array3));

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.0140.00418.48
8.3.50.0110.00621.20
8.3.40.0130.00918.93
8.3.30.0140.00420.39
8.3.20.0070.00020.34
8.3.10.0080.00021.71
8.3.00.0000.00722.40
8.2.180.0120.00616.74
8.2.170.0100.01022.96
8.2.160.0070.00722.20
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.79
8.2.110.0100.00022.08
8.2.100.0090.00317.84
8.2.90.0070.00019.22
8.2.80.0090.00019.28
8.2.70.0060.00617.50
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0070.00018.09
8.2.30.0000.00919.52
8.2.20.0040.00417.84
8.2.10.0030.00517.71
8.2.00.0060.00317.64
8.1.280.0060.01225.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00423.88
8.1.230.0080.00418.99
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0030.00617.65
8.1.180.0000.00919.13
8.1.170.0080.00018.63
8.1.160.0040.00418.79
8.1.150.0050.00318.71
8.1.140.0000.00717.39
8.1.130.0040.00417.87
8.1.120.0040.00417.47
8.1.110.0040.00417.48
8.1.100.0050.00317.41
8.1.90.0000.00717.54
8.1.80.0040.00417.54
8.1.70.0030.00317.48
8.1.60.0030.00617.54
8.1.50.0040.00417.45
8.1.40.0000.00917.55
8.1.30.0050.00317.55
8.1.20.0060.00317.61
8.1.10.0000.00817.59
8.1.00.0050.00317.54
8.0.300.0040.00418.77
8.0.290.0040.00416.93
8.0.280.0030.00318.43
8.0.270.0000.00717.29
8.0.260.0000.00716.94
8.0.250.0060.00017.06
8.0.240.0060.00316.94
8.0.230.0070.00016.95
8.0.220.0040.00416.96
8.0.210.0000.00816.91
8.0.200.0070.00017.02
8.0.190.0070.00017.11
8.0.180.0030.00316.97
8.0.170.0030.00616.86
8.0.160.0000.00717.02
8.0.150.0040.00416.92
8.0.140.0080.00016.85
8.0.130.0000.00613.39
8.0.120.0030.00516.98
8.0.110.0040.00416.95
8.0.100.0040.00417.04
8.0.90.0060.00316.96
8.0.80.0060.00916.90
8.0.70.0040.00417.02
8.0.60.0050.00216.93
8.0.50.0000.00716.85
8.0.30.0060.01217.01
8.0.20.0090.01217.40
8.0.10.0000.00717.14
8.0.00.0050.01516.70
7.4.330.0000.00515.00
7.4.320.0000.00616.57
7.4.300.0060.00016.63
7.4.290.0030.00316.54
7.4.280.0000.00716.51
7.4.270.0040.00416.60
7.4.260.0000.00513.30
7.4.250.0000.00816.57
7.4.240.0020.00516.58
7.4.230.0070.00016.27
7.4.220.0120.00616.59
7.4.210.0060.00916.51
7.4.200.0050.00216.34
7.4.190.0070.00016.78
7.4.160.0150.00716.61
7.4.150.0090.00917.40
7.4.140.0100.00817.86
7.4.130.0070.01016.44
7.4.120.0090.01016.68
7.4.110.0090.01216.62
7.4.100.0090.01316.63
7.4.90.0090.01216.58
7.4.80.0090.01419.39
7.4.70.0090.01316.54
7.4.60.0040.01216.64
7.4.50.0040.00416.56
7.4.40.0040.01122.77
7.4.30.0090.00916.50
7.4.00.0020.01615.05
7.3.330.0020.00213.34
7.3.320.0000.00613.29
7.3.310.0000.00716.53
7.3.300.0030.00316.47
7.3.290.0050.00916.50
7.3.280.0120.00516.47
7.3.270.0120.00617.40
7.3.260.0100.01316.65
7.3.250.0130.00516.54
7.3.240.0100.01316.53
7.3.230.0030.01616.46
7.3.210.0150.00916.49
7.3.200.0100.00719.39
7.3.190.0090.01316.71
7.3.180.0100.00716.53
7.3.170.0060.00916.64
7.3.160.0130.00316.55
7.3.120.0040.01114.87
7.3.110.0070.01014.96
7.3.100.0100.00314.98
7.3.90.0000.01214.71
7.3.80.0030.00914.70
7.3.70.0150.00314.97
7.3.60.0060.00914.89
7.3.50.0030.00614.64
7.3.40.0000.01414.79
7.3.30.0030.00715.00
7.3.20.0130.00016.86
7.3.10.0070.00916.37
7.3.00.0090.00716.42
7.2.330.0120.00616.58
7.2.320.0080.01116.82
7.2.310.0140.00316.80
7.2.300.0100.00716.75
7.2.290.0070.01016.68
7.2.250.0130.00715.18
7.2.240.0120.00815.20
7.2.230.0060.01015.06
7.2.220.0090.00315.11
7.2.210.0000.01614.86
7.2.200.0100.01015.23
7.2.190.0030.01014.97
7.2.180.0030.01515.21
7.2.170.0100.00715.06
7.2.130.0150.00616.65
7.2.120.0070.01016.50
7.2.110.0120.00816.19
7.2.100.0150.01516.44
7.2.90.0110.01116.67
7.2.80.0130.01316.60
7.2.70.0030.01516.10
7.2.60.0100.01016.48
7.2.50.0140.00716.58
7.2.40.0180.00916.42
7.2.30.0130.00616.73
7.2.20.0260.00616.70
7.2.10.0260.00816.83
7.2.00.0110.01218.01
7.1.330.0080.00615.97
7.1.320.0040.01115.64
7.1.310.0030.00615.73
7.1.300.0050.00315.97
7.1.290.0000.01515.85
7.1.280.0000.01315.65
7.1.270.0030.00615.86
7.1.260.0030.01215.54
7.1.250.0130.00615.47
7.1.100.0030.01017.80
7.1.70.0000.00717.27
7.1.60.0140.01019.32
7.1.50.0070.01316.64
7.1.00.0030.04022.41
7.0.200.0000.00716.80
7.0.140.0030.07322.09
7.0.100.0130.08019.96
7.0.90.0070.07319.97
7.0.80.0030.05320.16
7.0.70.0300.05320.00
7.0.60.0100.07719.91
7.0.50.0070.08020.34
7.0.40.0030.07020.08
7.0.30.0030.08720.18
7.0.20.0100.07720.07
7.0.10.0030.06020.05
7.0.00.0030.08319.98
5.6.280.0070.07321.07
5.6.250.0070.08320.57
5.6.240.0100.08320.68
5.6.230.0230.06720.57
5.6.220.0000.08320.63
5.6.210.0100.08020.50
5.6.200.0030.08021.14
5.6.190.0030.08720.95
5.6.180.0000.08721.04
5.6.170.0070.05320.96
5.6.160.0100.07721.09
5.6.150.0070.07721.03
5.6.140.0130.07721.12
5.6.130.0100.08721.02
5.6.120.0100.08321.14
5.6.110.0070.05021.10
5.6.100.0130.07021.11
5.6.90.0100.07321.05
5.6.80.0030.08320.42
5.6.70.0030.08320.39
5.6.60.0030.06020.33
5.6.50.0100.08020.34
5.6.40.0130.06720.41
5.6.30.0100.07020.25
5.6.20.0100.04020.42
5.6.10.0130.07020.39
5.6.00.0070.07720.41
5.5.380.0030.08020.36
5.5.370.0070.08020.43
5.5.360.0100.07720.34
5.5.350.0000.08720.44
5.5.340.0070.06020.94
5.5.330.0030.08720.81
5.5.320.0100.08020.79
5.5.310.0070.08020.81
5.5.300.0200.07020.82
5.5.290.0170.07320.94
5.5.280.0100.05020.91
5.5.270.0100.08720.73
5.5.260.0100.06020.92
5.5.250.0070.07320.55
5.5.240.0070.04320.04
5.5.230.0070.06320.22
5.5.220.0030.08320.22
5.5.210.0100.06320.21
5.5.200.0030.04320.24
5.5.190.0130.07720.19
5.5.180.0030.08020.20
5.5.160.0170.07020.23
5.5.150.0000.08720.22
5.5.140.0030.07320.07
5.5.130.0070.05720.27
5.5.120.0000.07720.16
5.5.110.0070.03720.16
5.5.100.0070.04020.08
5.5.90.0070.08319.98
5.5.80.0100.07320.21
5.5.70.0030.04719.94
5.5.60.0030.07720.14
5.5.50.0030.05320.16
5.5.40.0030.04320.06
5.5.30.0070.06020.06
5.5.20.0000.05020.14
5.5.10.0070.06720.04
5.5.00.0070.07320.14
5.4.450.0100.07719.50
5.4.440.0070.08319.45
5.4.430.0070.07019.46
5.4.420.0130.05019.27
5.4.410.0070.07319.34
5.4.400.0130.07319.05
5.4.390.0130.05719.16
5.4.380.0070.04319.17
5.4.370.0170.06718.90
5.4.360.0070.07319.04
5.4.350.0070.07719.24
5.4.340.0170.07019.10
5.4.320.0100.07019.12
5.4.310.0030.08319.14
5.4.300.0070.07318.88
5.4.290.0070.04019.14
5.4.280.0070.04019.14
5.4.270.0070.07719.18
5.4.260.0030.08318.95
5.4.250.0070.03319.14
5.4.240.0030.07719.00
5.4.230.0100.07019.13
5.4.220.0030.05319.13
5.4.210.0100.07019.04
5.4.200.0030.03719.16
5.4.190.0030.07719.12
5.4.180.0070.04019.13
5.4.170.0070.05318.88
5.4.160.0130.06018.88
5.4.150.0070.07318.86
5.4.140.0100.06016.51
5.4.130.0100.07016.52
5.4.120.0070.06316.49
5.4.110.0000.04716.57
5.4.100.0070.03716.45
5.4.90.0130.04316.45
5.4.80.0030.07316.43
5.4.70.0070.04016.51
5.4.60.0030.07316.45
5.4.50.0070.07716.44
5.4.40.0100.07016.38
5.4.30.0070.07716.26
5.4.20.0030.06716.38
5.4.10.0100.06316.46
5.4.00.0130.06315.90
5.3.290.0070.05314.70
5.3.280.0070.04314.72
5.3.270.0030.05314.68
5.3.260.0070.06314.75
5.3.250.0100.05714.65
5.3.240.0070.07014.60
5.3.230.0000.07014.63
5.3.220.0100.07014.64
5.3.210.0000.05314.51
5.3.200.0030.06714.50
5.3.190.0070.04014.61
5.3.180.0000.04714.53
5.3.170.0070.06714.63
5.3.160.0170.06314.56
5.3.150.0130.06014.50
5.3.140.0030.06714.54
5.3.130.0030.06714.68
5.3.120.0030.06714.58
5.3.110.0100.07014.51
5.3.100.0070.06014.20
5.3.90.0030.05314.14
5.3.80.0030.08013.94
5.3.70.0070.06014.02
5.3.60.0030.07714.02
5.3.50.0100.03313.96
5.3.40.0000.06014.02
5.3.30.0070.06313.96
5.3.20.0100.07013.68
5.3.10.0100.06713.58
5.3.00.0100.03713.63
5.2.170.0030.04011.27
5.2.160.0030.03011.25
5.2.150.0000.05011.29
5.2.140.0000.03711.26
5.2.130.0130.02311.14
5.2.120.0030.04311.20
5.2.110.0070.06311.14
5.2.100.0130.05311.21
5.2.90.0000.05011.03
5.2.80.0030.06311.21
5.2.70.0030.06711.21
5.2.60.0000.05011.17
5.2.50.0000.05311.13
5.2.40.0100.05711.07
5.2.30.0070.03710.97
5.2.20.0070.05310.88
5.2.10.0100.05010.80
5.2.00.0070.04010.66
5.1.60.0070.04310.09
5.1.50.0030.05710.08
5.1.40.0130.04710.11
5.1.30.0070.05710.46
5.1.20.0100.04310.28
5.1.10.0030.05710.13
5.1.00.0030.04710.11
5.0.50.0000.0409.94
5.0.40.0030.0439.94
5.0.30.0070.0579.94
5.0.20.0000.0409.94
5.0.10.0000.0279.94
5.0.00.0070.0579.94
4.4.90.0000.0379.94
4.4.80.0030.0379.94
4.4.70.0030.0139.94
4.4.60.0000.0339.94
4.4.50.0030.0339.94
4.4.40.0000.0409.94
4.4.30.0000.0379.94
4.4.20.0000.0279.94
4.4.10.0000.0409.94
4.4.00.0000.0539.94
4.3.110.0070.0309.94
4.3.100.0030.0339.94
4.3.90.0030.0209.94
4.3.80.0070.0479.94
4.3.70.0000.0179.94
4.3.60.0130.0109.94
4.3.50.0000.0379.94
4.3.40.0070.0509.94
4.3.30.0000.0309.94
4.3.20.0030.0309.94
4.3.10.0000.0309.94
4.3.00.0000.0339.94

preferences:
62.56 ms | 401 KiB | 5 Q