3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * make sure the setA and setB are the same */ function isSame($setA, $setB) { if (!is_array($setA) && !is_array($setB)) { return $setA == $setB; } if (!is_array($setA) || !is_array($setB)) { return false; } $keys = array_intersect_key($setA, $setB); if ((count($keys) != count($setA)) || (count($keys) != count($setB))) { return false; } foreach ($keys as $k => $v) { if (!isSame($setA[$k], $setB[$k])) { return false; } } return true; } /* * return true if setA has all capabilities in setB. Here the comparison is on actual capabilities, and nothing * fancy like number of capabilities or a weighted sum of capabilities. In other words, return true if setB is a * subset of setA. * * NOTE: This function does not validate if the inputs are really capability lists. * * @param array setA - master list to compare against * @param array setB - subset to be compared * * @return bool */ function hasAllCapabilities($setA, $setB) { if(!isset($setA)) $setA = array(); if(!is_array($setA)) $setA = array($setA); if(!isset($setB)) $setB = array(); if(!is_array($setB)) $setB = array($setB); foreach ($setB as $k=>$v) { if (array_key_exists($k, $setA)) { if (!isSame($setA[$k], $v)) { return false; } } else { return false; } } return true; } $a=array(101=>array(1,2,3), 100=>array(2,3)); $b=array(101=>array(1,2,3)); echo hasAllCapabilities($a, $b);

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.0160.00316.59
8.3.50.0060.00919.87
8.3.40.0070.00718.79
8.3.30.0100.00719.23
8.3.20.0070.00020.16
8.3.10.0040.00423.48
8.3.00.0000.00819.25
8.2.180.0140.00316.47
8.2.170.0170.00022.96
8.2.160.0100.01020.47
8.2.150.0070.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00821.04
8.2.110.0040.00419.22
8.2.100.0070.00417.84
8.2.90.0060.00319.17
8.2.80.0030.00617.97
8.2.70.0030.00717.61
8.2.60.0090.00018.03
8.2.50.0000.00818.07
8.2.40.0030.00520.01
8.2.30.0000.00818.00
8.2.20.0030.00517.73
8.2.10.0000.00718.13
8.2.00.0050.00317.62
8.1.280.0040.01125.92
8.1.270.0000.00823.87
8.1.260.0040.00426.35
8.1.250.0110.00328.09
8.1.240.0150.00721.11
8.1.230.0060.00617.52
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0000.00818.65
8.1.160.0040.00422.03
8.1.150.0040.00418.89
8.1.140.0040.00417.46
8.1.130.0070.00017.68
8.1.120.0000.00717.49
8.1.110.0020.00517.50
8.1.100.0030.00317.50
8.1.90.0000.00717.43
8.1.80.0040.00417.52
8.1.70.0040.00417.38
8.1.60.0030.00617.64
8.1.50.0080.00017.54
8.1.40.0040.00417.50
8.1.30.0040.00417.66
8.1.20.0030.00517.59
8.1.10.0050.00217.55
8.1.00.0000.00817.55
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0040.00418.30
8.0.270.0050.00217.17
8.0.260.0060.00017.21
8.0.250.0030.00316.94
8.0.240.0000.00816.89
8.0.230.0000.00716.95
8.0.220.0070.00016.75
8.0.210.0000.00716.91
8.0.200.0030.00616.84
8.0.190.0030.00516.86
8.0.180.0090.00316.95
8.0.170.0030.00616.96
8.0.160.0000.00716.96
8.0.150.0040.00416.73
8.0.140.0070.00016.90
8.0.130.0000.00613.41
8.0.120.0070.00016.77
8.0.110.0000.00716.79
8.0.100.0040.00416.93
8.0.90.0000.00717.01
8.0.80.0120.00316.95
8.0.70.0030.00516.95
8.0.60.0070.00016.78
8.0.50.0020.00516.69
8.0.30.0120.01017.13
8.0.20.0090.01017.40
8.0.10.0050.00216.90
8.0.00.0030.01316.71
7.4.330.0060.00015.08
7.4.320.0000.00616.53
7.4.300.0070.00016.56
7.4.290.0030.00316.43
7.4.280.0030.00616.50
7.4.270.0000.00716.62
7.4.260.0000.00716.58
7.4.250.0050.00216.47
7.4.240.0020.00516.54
7.4.230.0000.00716.70
7.4.220.0110.00716.45
7.4.210.0090.00616.38
7.4.200.0030.00616.25
7.4.160.0050.01116.46
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0120.00716.51
7.4.120.0080.00916.46
7.4.110.0160.00716.46
7.4.100.0100.00616.52
7.4.90.0110.00616.52
7.4.80.0140.00319.39
7.4.70.0100.01316.52
7.4.60.0140.00316.51
7.4.50.0030.00316.54
7.4.40.0120.00316.53
7.4.30.0060.01016.45
7.4.00.0070.00714.73
7.3.330.0030.00313.39
7.3.320.0060.00013.43
7.3.310.0000.00716.44
7.3.300.0070.00016.33
7.3.290.0100.01016.41
7.3.280.0130.00516.40
7.3.270.0070.01017.40
7.3.260.0110.00616.35
7.3.250.0060.01116.51
7.3.240.0030.01316.32
7.3.230.0070.01016.64
7.3.210.0100.01016.37
7.3.200.0070.01019.39
7.3.190.0070.01016.30
7.3.180.0130.00316.64
7.3.170.0100.01016.48
7.3.160.0070.01316.36
7.3.10.0120.00516.63
7.3.00.0100.00616.65
7.2.330.0050.01216.47
7.2.320.0070.01316.63
7.2.310.0070.01016.86
7.2.300.0030.01316.89
7.2.290.0160.00716.57
7.2.130.0100.00916.83
7.2.120.0100.00716.80
7.2.110.0050.01116.98
7.2.100.0090.00716.92
7.2.90.0080.00716.89
7.2.80.0050.00916.96
7.2.70.0150.00416.74
7.2.60.0100.00616.90
7.2.50.0100.00816.84
7.2.40.0090.00816.98
7.2.30.0140.00716.85
7.2.20.0120.00916.85
7.2.10.0160.00716.79
7.2.00.0120.00917.75
7.1.250.0100.00415.71
7.1.200.0090.00015.63
7.1.100.0090.00318.02
7.1.70.0000.01617.09
7.1.60.0130.00919.40
7.1.50.0060.01917.01
7.1.00.0000.09722.28
7.0.200.0000.01016.89
7.0.140.0070.07022.02
7.0.60.0030.06020.04
7.0.50.0200.03717.90
7.0.40.0070.07720.25
7.0.30.0330.04720.23
7.0.20.0370.07020.04
7.0.10.0070.05020.08
7.0.00.0000.05720.22
5.6.280.0000.07721.09
5.6.210.0100.06020.52
5.6.200.0030.08718.13
5.6.190.0170.07720.51
5.6.180.0200.04320.61
5.6.170.0200.06320.54
5.6.160.0030.05020.55
5.6.150.0070.04318.16
5.6.140.0030.04318.18
5.6.130.0070.09018.23
5.6.120.0230.06721.01
5.6.110.0130.08720.98
5.6.100.0030.08020.86
5.6.90.0130.03321.11
5.6.80.0230.05020.42
5.5.350.4000.04020.39
5.5.340.0030.08318.02
5.5.330.0100.07720.57
5.5.320.2470.04020.27
5.5.310.0130.03320.24
5.5.300.0030.08718.10
5.5.290.0070.04718.01
5.5.280.0030.04020.77
5.5.270.0030.04020.75
5.5.260.0030.05720.84
5.5.250.0100.08020.64
5.5.240.0100.07320.19
5.4.450.0170.05319.30
5.4.440.0030.05319.53
5.4.430.0230.05019.45
5.4.420.0230.04019.52
5.4.410.0470.04719.30
5.4.400.0170.04019.16
5.4.390.0270.04019.31
5.4.380.0500.07718.78
5.4.370.1070.06718.75
5.4.360.0930.04718.51
5.4.350.0770.06718.56
5.4.340.0770.05018.74
5.4.320.0080.05112.51
5.4.310.0040.04012.51
5.4.300.0030.04012.50
5.4.290.0090.03712.50
5.4.280.0040.03812.40
5.4.270.0060.03712.40
5.4.260.0090.03512.40
5.4.250.0070.03712.40
5.4.240.0120.03712.41
5.4.230.0050.05512.40
5.4.220.0050.04212.39
5.4.210.0050.03612.40
5.4.200.0060.04312.39
5.4.190.0040.03812.39
5.4.180.0030.03912.39
5.4.170.0050.03712.40
5.4.160.0090.03212.39
5.4.150.0050.03512.39
5.4.140.0030.03912.07
5.4.130.0080.03312.06
5.4.120.0050.03612.02
5.4.110.0080.03312.02
5.4.100.0040.03712.02
5.4.90.0070.03612.02
5.4.80.0110.03112.02
5.4.70.0060.03312.01
5.4.60.0090.04812.02
5.4.50.0070.03412.01
5.4.40.0070.04312.00
5.4.30.0050.03712.00
5.4.20.0060.03512.00
5.4.10.0040.03612.00
5.4.00.0080.03411.49
5.3.290.0090.03612.80
5.3.280.0060.03812.71
5.3.270.0060.03912.72
5.3.260.0080.03712.72
5.3.250.0060.05712.72
5.3.240.0070.04512.72
5.3.230.0060.04512.70
5.3.220.0080.03612.68
5.3.210.0030.04312.68
5.3.200.0080.03712.68
5.3.190.0090.05112.68
5.3.180.0090.03912.67
5.3.170.0080.04912.67
5.3.160.0120.04112.67
5.3.150.0060.03812.67
5.3.140.0070.04712.66
5.3.130.0050.04012.66
5.3.120.0040.04112.65
5.3.110.0060.03912.66
5.3.100.0050.03612.13
5.3.90.0070.03512.11
5.3.80.0080.03312.10
5.3.70.0060.03612.10
5.3.60.0050.03712.08
5.3.50.0080.04012.04
5.3.40.0080.04012.03
5.3.30.0070.03611.99
5.3.20.0060.03511.78
5.3.10.0100.03711.74
5.3.00.0080.03811.72
5.2.170.0070.0339.23
5.2.160.0080.0259.23
5.2.150.0040.0389.24
5.2.140.0040.0339.23
5.2.130.0040.0359.19
5.2.120.0020.0309.20
5.2.110.0050.0289.20
5.2.100.0030.0339.19
5.2.90.0030.0309.19
5.2.80.0040.0309.18
5.2.70.0030.0319.18
5.2.60.0080.0279.14
5.2.50.0060.0329.12
5.2.40.0050.0289.09
5.2.30.0050.0299.06
5.2.20.0050.0279.05
5.2.10.0040.0288.96
5.2.00.0110.0298.83
5.1.60.0070.0368.11
5.1.50.0030.0368.10
5.1.40.0030.0318.08
5.1.30.0070.0288.43
5.1.20.0060.0278.45
5.1.10.0030.0408.18
5.1.00.0060.0248.18
5.0.50.0040.0256.68
5.0.40.0040.0196.54
5.0.30.0050.0396.35
5.0.20.0030.0206.31
5.0.10.0060.0186.29
5.0.00.0040.0366.29
4.4.90.0000.0184.78
4.4.80.0060.0114.76
4.4.70.0030.0154.76
4.4.60.0010.0174.76
4.4.50.0000.0244.77
4.4.40.0040.0304.71
4.4.30.0030.0244.76
4.4.20.0060.0154.85
4.4.10.0050.0304.85
4.4.00.0020.0284.76
4.3.110.0020.0164.67
4.3.100.0030.0214.67
4.3.90.0060.0154.63
4.3.80.0010.0294.59
4.3.70.0020.0154.63
4.3.60.0040.0134.63
4.3.50.0020.0204.63
4.3.40.0020.0244.54
4.3.30.0010.0173.33
4.3.20.0020.0173.32
4.3.10.0010.0163.27
4.3.00.0000.02015.62

preferences:
71.64 ms | 400 KiB | 5 Q