3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new StdClass(); $b = new StdClass(); $array1 = array($a, $a, $b); $array2 = array($a, $b, $b); 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; }; $count1 = countHashes($array1); $count2 = countHashes($array2); var_dump($count1); var_dump($count2); if (count($count1) === count($count2)) { foreach ($count1 as $key => $value) { echo $key . " and " . $value . "\n"; if ($count2[$key] !== $value) { echo 'not the same!'; } } }

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.0150.00018.18
8.3.50.0040.01122.11
8.3.40.0170.00318.94
8.3.30.0060.00919.10
8.3.20.0040.00420.34
8.3.10.0080.00021.94
8.3.00.0050.00317.66
8.2.180.0160.00316.63
8.2.170.0060.00922.96
8.2.160.0100.00620.52
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.97
8.2.110.0100.00022.08
8.2.100.0060.00619.45
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0000.00817.49
8.2.60.0000.00917.91
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0000.00718.31
8.2.20.0040.00417.63
8.2.10.0040.00418.23
8.2.00.0040.00417.73
8.1.280.0150.00325.92
8.1.270.0080.00023.84
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.91
8.1.230.0070.00419.00
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0030.00617.36
8.1.190.0040.00417.35
8.1.180.0090.00018.10
8.1.170.0040.00418.57
8.1.160.0070.00022.11
8.1.150.0000.00818.83
8.1.140.0040.00417.40
8.1.130.0000.00717.74
8.1.120.0000.00717.49
8.1.110.0030.00517.46
8.1.100.0070.00017.53
8.1.90.0000.00717.39
8.1.80.0050.00217.40
8.1.70.0000.00717.45
8.1.60.0050.00317.55
8.1.50.0050.00317.57
8.1.40.0040.00417.39
8.1.30.0000.00917.57
8.1.20.0000.00817.68
8.1.10.0060.00317.61
8.1.00.0030.00517.41
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0000.00718.42
8.0.270.0000.00717.29
8.0.260.0000.00817.29
8.0.250.0000.00717.05
8.0.240.0070.00016.99
8.0.230.0000.00716.90
8.0.220.0000.00716.94
8.0.210.0030.00316.91
8.0.200.0040.00416.88
8.0.190.0030.00516.95
8.0.180.0080.00016.95
8.0.170.0040.00416.96
8.0.160.0000.00817.00
8.0.150.0040.00416.78
8.0.140.0040.00416.78
8.0.130.0000.00713.34
8.0.120.0000.00716.89
8.0.110.0040.00416.93
8.0.100.0000.00816.88
8.0.90.0000.00716.74
8.0.80.0140.00716.87
8.0.70.0060.00316.95
8.0.60.0000.00716.71
8.0.50.0080.00016.83
8.0.30.0130.00717.14
8.0.20.0080.01217.40
8.0.10.0000.00816.93
8.0.00.0070.01216.72
7.4.330.0000.00515.12
7.4.320.0030.00316.53
7.4.300.0060.00016.55
7.4.290.0030.00316.44
7.4.280.0030.00316.63
7.4.270.0000.00716.45
7.4.260.0030.00316.60
7.4.250.0040.00416.50
7.4.240.0030.00416.63
7.4.230.0000.00716.44
7.4.220.0150.00616.74
7.4.210.0120.00316.54
7.4.200.0000.00716.62
7.4.160.0090.00916.54
7.4.150.0100.00717.40
7.4.140.0070.01017.86
7.4.130.0040.01216.62
7.4.120.0100.00616.51
7.4.110.0140.00416.55
7.4.100.0090.00916.54
7.4.90.0100.00716.46
7.4.80.0100.00819.39
7.4.70.0150.00616.53
7.4.60.0060.01216.55
7.4.50.0000.00516.57
7.4.40.0070.01016.54
7.4.30.0090.01216.43
7.4.10.0060.01114.97
7.4.00.0060.01114.77
7.3.330.0030.00313.17
7.3.320.0020.00213.39
7.3.310.0070.00016.39
7.3.300.0040.00416.45
7.3.290.0100.01016.48
7.3.280.0070.00916.39
7.3.270.0110.00717.40
7.3.260.0070.01616.45
7.3.250.0100.00716.62
7.3.240.0060.01216.37
7.3.230.0060.01516.39
7.3.210.0130.00316.41
7.3.200.0040.01419.39
7.3.190.0140.00316.33
7.3.180.0110.00416.39
7.3.170.0040.01216.63
7.3.160.0080.00816.35
7.3.130.0060.01214.84
7.3.120.0080.00914.78
7.3.110.0090.00714.83
7.3.100.0100.00414.86
7.3.90.0090.00414.91
7.3.80.0050.00714.95
7.3.70.0040.00914.91
7.3.60.0050.00914.76
7.3.50.0090.00414.74
7.3.40.0090.00814.74
7.3.30.0080.00614.66
7.3.20.0050.01016.73
7.3.10.0070.00716.69
7.3.00.0080.00616.68
7.2.330.0060.01216.64
7.2.320.0100.01016.63
7.2.310.0040.01416.57
7.2.300.0030.01416.79
7.2.290.0090.01216.81
7.2.260.0090.00615.30
7.2.250.0070.01315.04
7.2.240.0080.00915.04
7.2.230.0040.00915.14
7.2.220.0050.01215.25
7.2.210.0070.01015.11
7.2.200.0120.00414.97
7.2.190.0050.00815.04
7.2.180.0080.00814.93
7.2.170.0020.01515.06
7.2.160.0180.00015.29
7.2.150.0120.00416.82
7.2.140.0110.00717.15
7.2.130.0090.00616.95
7.2.120.0030.00616.95
7.2.110.0060.00916.82
7.2.100.0120.00316.99
7.2.90.0070.01116.69
7.2.80.0070.00316.87
7.2.70.0040.01417.01
7.2.60.0000.01216.90
7.2.50.0070.01017.13
7.2.40.0030.00917.06
7.2.30.0040.01117.09
7.2.20.0030.01017.02
7.2.10.0030.01317.07
7.2.00.0050.00818.20
7.1.330.0070.00815.84
7.1.320.0060.00815.88
7.1.310.0040.00915.71
7.1.300.0080.00715.79
7.1.290.0020.01315.82
7.1.280.0040.01015.71
7.1.270.0070.00615.82
7.1.260.0060.00815.91
7.1.250.0040.01115.76
7.1.240.0000.01115.94
7.1.230.0060.00915.83
7.1.220.0090.00615.90
7.1.210.0100.00715.77
7.1.200.0060.00615.77
7.1.190.0030.00915.79
7.1.180.0070.00716.00
7.1.170.0040.00816.00
7.1.160.0030.01015.46
7.1.150.0030.00715.66
7.1.140.0030.01015.88
7.1.130.0000.01715.77
7.1.120.0040.01115.60
7.1.110.0110.00015.89
7.1.100.0050.00917.07
7.1.90.0000.01015.66
7.1.80.0060.00615.91
7.1.70.0050.00716.34
7.1.60.0060.01317.74
7.1.50.0020.00916.28
7.1.40.0070.00715.77
7.1.30.0110.00415.62
7.1.20.0130.00315.83
7.1.10.0090.00615.68
7.1.00.0060.04019.14
7.0.330.0060.00615.30
7.0.320.0090.00615.18
7.0.310.0080.00415.52
7.0.300.0050.00515.51
7.0.290.0080.00515.40
7.0.280.0030.01315.37
7.0.270.0110.00315.45
7.0.260.0130.00015.36
7.0.250.0030.01315.25
7.0.240.0100.00315.47
7.0.230.0090.00915.24
7.0.220.0030.01015.45
7.0.210.0070.00715.33
7.0.200.2470.00515.96
7.0.190.0000.01315.55
7.0.180.0130.00315.37
7.0.170.0040.01115.37
7.0.160.0030.01215.50
7.0.150.0080.00615.37
7.0.140.0050.04018.69
7.0.130.0060.00615.50
7.0.120.0030.00615.62
7.0.110.0040.00815.62
7.0.100.0040.01115.44
7.0.90.0050.00815.43
7.0.80.0030.01215.50
7.0.70.0050.03218.55
7.0.60.0050.04818.60
7.0.50.0080.04518.69
7.0.40.0070.04516.75
7.0.30.0050.03216.73
7.0.20.0050.04716.63
7.0.10.0050.04816.77
7.0.00.0020.04716.80
5.6.400.0040.00814.83
5.6.390.0110.00314.58
5.6.380.0140.00314.65
5.6.370.0030.01214.58
5.6.360.0000.01514.48
5.6.350.0070.00714.66
5.6.340.0030.01014.61
5.6.330.0040.01114.15
5.6.320.0070.00714.70
5.6.310.0000.01414.10
5.6.300.0100.00314.12
5.6.290.0040.00814.66
5.6.280.0010.04317.85
5.6.270.0030.01314.52
5.6.260.0110.00314.48
5.6.250.0070.01114.30
5.6.240.0120.00314.40
5.6.230.0000.01314.44
5.6.220.0080.04117.37
5.6.210.0070.04517.54
5.6.200.0030.05217.82
5.6.190.0050.04217.87
5.6.180.0070.04317.64
5.6.170.0070.04517.83
5.6.160.0050.04517.66
5.6.150.0070.04317.79
5.6.140.0050.02817.87
5.6.130.0030.04217.71
5.6.120.0080.04417.74
5.6.110.0050.05117.72
5.6.100.0070.04617.75
5.6.90.0030.03517.77
5.6.80.0020.04817.29
5.6.70.0050.04017.39
5.6.60.0050.04317.43
5.6.50.0050.04317.48
5.6.40.0030.04717.41
5.6.30.0030.03917.28
5.6.20.0060.03317.47
5.6.10.0060.04317.40
5.6.00.0050.04717.40
5.5.380.0030.01014.78
5.5.370.0090.00614.09
5.5.360.0080.04817.34
5.5.350.0080.04617.44
5.5.340.0120.03717.63
5.5.330.0030.02717.44
5.5.320.0050.04817.68
5.5.310.0090.03617.71
5.5.300.0050.04717.75
5.5.290.0090.04417.57
5.5.280.0060.03317.75
5.5.270.0070.04917.72
5.5.260.0050.04917.68
5.5.250.0050.04317.41
5.5.240.0080.03817.33
5.5.230.0060.04317.49
5.5.220.0050.02917.22
5.5.210.0060.03617.34
5.5.200.0050.04517.19
5.5.190.0070.04217.25
5.5.180.0030.04517.40
5.5.170.0030.01014.23
5.5.160.0040.03517.05
5.5.150.0050.04417.33
5.5.140.0020.04517.36
5.5.130.0060.03817.15
5.5.120.0080.04317.35
5.5.110.0080.04317.21
5.5.100.0030.03817.16
5.5.90.0080.04117.00
5.5.80.0020.03517.19
5.5.70.0070.03917.30
5.5.60.0050.04117.26
5.5.50.0060.03917.03
5.5.40.0020.04317.20
5.5.30.0050.02217.33
5.5.20.0070.04217.14
5.5.10.0030.04017.28
5.5.00.0030.02417.17
5.4.450.0070.03515.37
5.4.440.0050.04315.20
5.4.430.0030.03315.27
5.4.420.0050.02915.37
5.4.410.0020.04115.26
5.4.400.0060.04015.17
5.4.390.0050.03215.14
5.4.380.0030.04714.90
5.4.370.0100.03514.95
5.4.360.0070.03815.22
5.4.350.0030.03615.13
5.4.340.0060.04315.03
5.4.330.0070.00711.14
5.4.320.0090.03615.17
5.4.310.0080.03714.99
5.4.300.0020.04315.21
5.4.290.0040.03515.12
5.4.280.0050.03515.07
5.4.270.0020.02915.05
5.4.260.0030.04315.18
5.4.250.0040.03915.23
5.4.240.0030.04014.89
5.4.230.0070.03215.11
5.4.220.0020.02814.92
5.4.210.0030.04315.08
5.4.200.0050.03714.86
5.4.190.0040.02114.99
5.4.180.0020.03314.97
5.4.170.0000.02415.08
5.4.160.0020.02715.00
5.4.150.0040.02215.13
5.4.140.0000.03413.93
5.4.130.0070.02713.93
5.4.120.0070.02413.80
5.4.110.0030.02513.66
5.4.100.0030.02313.87
5.4.90.0030.03113.79
5.4.80.0020.04213.76
5.4.70.0030.03713.88
5.4.60.0070.02013.79
5.4.50.0080.02013.86
5.4.40.0070.01613.71
5.4.30.0050.02213.84
5.4.20.0070.03313.76
5.4.10.0010.02313.83
5.4.00.0020.03013.55
5.3.290.0030.02512.57
5.3.280.0030.03512.61
5.3.270.0020.02812.73
5.3.260.0030.02512.61
5.3.250.0040.02212.62
5.3.240.0000.02712.58
5.3.230.0030.02912.60
5.3.220.0020.02512.60
5.3.210.0020.02712.62
5.3.200.0020.02212.53
5.3.190.0060.03612.54
5.3.180.0080.03012.60
5.3.170.0080.03712.51
5.3.160.0050.02312.67
5.3.150.0070.02812.57
5.3.140.0050.01912.59
5.3.130.0040.03212.62
5.3.120.0030.02812.63
5.3.110.0030.02012.68
5.3.100.0030.02012.40
5.3.90.0050.02712.40
5.3.80.0010.02412.27
5.3.70.0020.02412.24
5.3.60.0000.02412.38
5.3.50.0020.02112.27
5.3.40.0060.02312.27
5.3.30.0000.03812.21
5.3.20.0030.02012.16
5.3.10.0040.01712.16
5.3.00.0020.02212.11
5.2.170.0030.03012.25
5.2.160.0000.04312.25
5.2.150.0030.03012.25
5.2.140.0030.03012.25
5.2.130.0000.03012.25
5.2.120.0070.02312.25
5.2.110.0030.03012.25
5.2.100.0030.02712.25
5.2.90.0000.03712.25
5.2.80.0030.04312.25
5.2.70.0030.02712.25
5.2.60.0000.04712.25
5.2.50.0000.03012.25
5.2.40.0070.02312.25
5.2.30.0000.03012.25
5.2.20.0030.02712.25
5.2.10.0030.02712.25
5.2.00.0000.03012.25
5.1.60.0070.04012.25
5.1.50.0030.02312.25
5.1.40.0000.02712.25
5.1.30.0000.02712.25
5.1.20.0000.02712.25
5.1.10.0070.02712.25
5.1.00.0000.04012.25
5.0.50.0030.04712.25
5.0.40.0030.04312.25
5.0.30.0000.06712.25
5.0.20.0070.04012.25
5.0.10.0000.04712.25
5.0.00.0000.04312.25
4.4.90.0000.01712.25
4.4.80.0030.01312.25
4.4.70.0030.01312.25
4.4.60.0030.01312.25
4.4.50.0000.01712.25
4.4.40.0000.05312.25
4.4.30.0030.01312.25
4.4.20.0000.01712.25
4.4.10.0000.03312.25
4.4.00.0000.04312.25
4.3.110.0030.03012.25
4.3.100.0000.03312.25
4.3.90.0030.03312.25
4.3.80.0030.04312.25
4.3.70.0000.03312.25
4.3.60.0000.03012.25
4.3.50.0000.03712.25
4.3.40.0030.04312.25
4.3.30.0030.03312.25
4.3.20.0000.03712.25
4.3.10.0000.04012.25
4.3.00.0000.03012.25

preferences:
56.02 ms | 401 KiB | 5 Q