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)); 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.0140.00316.63
8.3.50.0190.01122.89
8.3.40.0100.01018.84
8.3.30.0100.00619.13
8.3.20.0080.00020.42
8.3.10.0060.00323.51
8.3.00.0050.00319.38
8.2.180.0120.00918.38
8.2.170.0140.00322.96
8.2.160.0120.00920.43
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0050.00320.93
8.2.110.0110.00019.39
8.2.100.0040.00817.84
8.2.90.0050.00220.31
8.2.80.0070.00319.15
8.2.70.0060.00319.22
8.2.60.0040.00419.79
8.2.50.0040.00418.10
8.2.40.0040.00420.59
8.2.30.0080.00018.19
8.2.20.0060.00317.73
8.2.10.0040.00418.07
8.2.00.0050.00217.75
8.1.280.0070.01325.92
8.1.270.0000.00823.97
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00619.23
8.1.230.0000.01020.82
8.1.220.0020.00517.74
8.1.210.0040.00418.89
8.1.200.0040.00417.35
8.1.190.0060.00317.23
8.1.180.0050.00318.10
8.1.170.0000.00818.35
8.1.160.0070.00022.15
8.1.150.0050.00218.81
8.1.140.0070.00017.46
8.1.130.0040.00417.83
8.1.120.0000.00717.41
8.1.110.0030.00317.43
8.1.100.0030.00517.46
8.1.90.0000.00717.45
8.1.80.0020.00517.46
8.1.70.0070.00017.44
8.1.60.0040.00417.59
8.1.50.0000.00817.42
8.1.40.0050.00317.55
8.1.30.0030.00617.57
8.1.20.0040.00417.64
8.1.10.0000.00717.56
8.1.00.0000.00817.48
8.0.300.0070.00019.98
8.0.290.0000.01016.75
8.0.280.0030.00318.45
8.0.270.0000.00817.22
8.0.260.0060.00017.21
8.0.250.0000.00717.00
8.0.240.0000.00816.96
8.0.230.0030.00316.84
8.0.220.0030.00316.93
8.0.210.0000.00716.93
8.0.200.0030.00516.96
8.0.190.0080.00016.95
8.0.180.0030.00616.82
8.0.170.0040.00416.94
8.0.160.0030.00316.88
8.0.150.0000.00716.80
8.0.140.0030.00516.88
8.0.130.0000.00613.35
8.0.120.0030.00616.89
8.0.110.0080.00016.87
8.0.100.0040.00416.89
8.0.90.0020.00516.79
8.0.80.0090.01316.96
8.0.70.0070.00016.96
8.0.60.0050.00316.85
8.0.50.0000.00716.91
8.0.30.0080.01417.01
8.0.20.0120.00717.40
8.0.10.0000.00717.13
8.0.00.0150.00616.82
7.4.330.0050.00015.06
7.4.320.0060.00016.60
7.4.300.0000.00616.41
7.4.290.0000.00616.53
7.4.280.0070.00316.63
7.4.270.0000.00616.60
7.4.260.0000.00716.51
7.4.250.0040.00416.39
7.4.240.0000.00816.52
7.4.230.0070.00016.59
7.4.220.0090.00916.68
7.4.210.0120.00916.61
7.4.200.0030.00616.63
7.4.160.0060.00916.55
7.4.150.0150.00617.40
7.4.140.0110.00917.86
7.4.130.0080.01216.41
7.4.120.0050.01116.59
7.4.110.0140.00716.56
7.4.100.0140.00316.47
7.4.90.0070.01016.57
7.4.80.0080.00819.39
7.4.70.0070.01416.66
7.4.60.0070.01016.51
7.4.50.0030.00316.53
7.4.40.0060.00916.62
7.4.30.0130.01016.53
7.4.00.0100.00715.08
7.3.330.0020.00313.14
7.3.320.0060.00013.40
7.3.310.0030.00316.22
7.3.300.0000.00716.33
7.3.290.0030.01316.32
7.3.280.0060.00916.31
7.3.270.0090.00917.40
7.3.260.0090.00916.26
7.3.250.0080.00916.46
7.3.240.0140.00316.64
7.3.230.0120.00416.66
7.3.210.0130.00316.63
7.3.200.0090.00919.39
7.3.190.0130.00316.50
7.3.180.0070.00716.50
7.3.170.0100.00616.61
7.3.160.0120.00816.40
7.2.330.0130.01016.80
7.2.320.0060.01016.64
7.2.310.0100.00716.68
7.2.300.0100.00716.80
7.2.290.0140.01116.81
7.2.60.0100.00716.66
7.1.200.0120.00315.80
7.1.100.0000.00818.12
7.1.70.0000.00717.02
7.1.60.0030.01017.20
7.1.50.0100.01316.74
7.1.00.0100.07022.54
7.0.200.0090.00616.61
7.0.140.0070.04322.10
7.0.60.0070.07319.88
7.0.50.0170.07317.98
7.0.40.0100.08020.20
7.0.30.0200.07320.33
7.0.20.0300.03020.22
7.0.10.0130.05020.07
7.0.00.0130.08320.16
5.6.210.0030.08720.72
5.6.200.0070.08018.20
5.6.190.0070.07020.41
5.6.180.4200.03320.52
5.6.170.0130.05020.47
5.6.160.0030.06020.61
5.6.150.0030.04018.18
5.6.140.0170.07318.29
5.6.130.0170.07718.17
5.6.120.0130.04720.97
5.6.110.0070.08321.14
5.6.100.0070.07020.98
5.6.90.0130.07720.96
5.6.80.0030.07020.40
5.6.70.4200.04320.48
5.5.350.0300.07320.53
5.5.340.0100.07718.07
5.5.330.0130.07720.31
5.5.320.0200.08020.34
5.5.310.0270.06320.30
5.5.300.0000.04018.07
5.5.290.0000.04318.01
5.5.280.0030.05320.65
5.5.270.0070.04320.73
5.5.260.0070.07020.64
5.5.250.0030.08320.59
5.5.240.0230.03720.29
5.4.450.0530.06719.48
5.4.440.0170.07319.61
5.4.430.0200.05719.58
5.4.420.0430.04019.61
5.4.410.0330.05319.35
5.4.400.0400.03719.29
5.4.390.0270.05019.26
5.4.380.0170.05018.58
5.4.370.0030.06718.75
5.4.360.0030.06318.59
5.4.350.0130.05718.73
5.4.340.0130.05318.73
5.4.320.0080.03412.50
5.4.310.0070.04112.50
5.4.300.0080.04412.51
5.4.290.0060.03912.51
5.4.280.0110.03012.40
5.4.270.0070.03512.40
5.4.260.0090.04312.41
5.4.250.0090.03912.41
5.4.240.0090.03812.40
5.4.230.0130.04612.39
5.4.220.0060.04712.39
5.4.210.0040.04012.39
5.4.200.0060.03812.39
5.4.190.0070.03612.39
5.4.180.0050.03712.39
5.4.170.0060.03712.40
5.4.160.0050.03712.39
5.4.150.0080.03512.39
5.4.140.0040.03912.07
5.4.130.0070.03512.06
5.4.120.0080.03512.02
5.4.110.0060.04212.02
5.4.100.0080.04712.02
5.4.90.0070.04712.02
5.4.80.0050.03912.02
5.4.70.0070.03312.01
5.4.60.0030.03712.01
5.4.50.0050.04112.01
5.4.40.0070.03312.00
5.4.30.0090.04112.00
5.4.20.0070.03312.00
5.4.10.0060.03412.00
5.4.00.0050.03611.49
5.3.290.0090.05012.80
5.3.280.0070.04512.71
5.3.270.0050.04112.72
5.3.260.0060.03912.72
5.3.250.0050.03912.71
5.3.240.0100.03412.72
5.3.230.0050.04012.71
5.3.220.0040.04112.68
5.3.210.0080.03812.68
5.3.200.0080.04612.68
5.3.190.0090.03412.68
5.3.180.0080.04112.67
5.3.170.0080.03912.67
5.3.160.0060.03612.67
5.3.150.0070.03712.67
5.3.140.0050.03812.66
5.3.130.0050.04112.66
5.3.120.0060.03912.66
5.3.110.0060.03912.66
5.3.100.0060.03712.12
5.3.90.0090.03412.11
5.3.80.0050.04712.10
5.3.70.0070.04012.10
5.3.60.0030.03912.09
5.3.50.0080.03512.03
5.3.40.0050.03712.04
5.3.30.0080.04312.00
5.3.20.0060.03511.78
5.3.10.0070.03611.74
5.3.00.0060.03711.72
5.2.170.0050.0319.24
5.2.160.0070.0459.24
5.2.150.0040.0329.24
5.2.140.0040.0329.23
5.2.130.0080.0329.19
5.2.120.0080.0279.19
5.2.110.0040.0329.20
5.2.100.0040.0299.19
5.2.90.0030.0309.19
5.2.80.0060.0289.18
5.2.70.0040.0409.18
5.2.60.0020.0329.14
5.2.50.0050.0329.12
5.2.40.0040.0299.09
5.2.30.0050.0369.06
5.2.20.0050.0299.05
5.2.10.0050.0298.96
5.2.00.0030.0328.83
5.1.60.0070.0288.10
5.1.50.0040.0268.10
5.1.40.0030.0258.08
5.1.30.0040.0298.44
5.1.20.0040.0338.45
5.1.10.0080.0308.18
5.1.00.0050.0298.18
5.0.50.0050.0206.67
5.0.40.0040.0266.54
5.0.30.0020.0346.35
5.0.20.0070.0186.31
5.0.10.0040.0216.29
5.0.00.0060.0326.29
4.4.90.0040.0194.78
4.4.80.0030.0154.76
4.4.70.0040.0234.75
4.4.60.0050.0204.76
4.4.50.0030.0174.77
4.4.40.0050.0234.71
4.4.30.0030.0164.76
4.4.20.0030.0154.84
4.4.10.0020.0204.84
4.4.00.0020.0264.76
4.3.110.0040.0204.67
4.3.100.0050.0124.66
4.3.90.0050.0174.63
4.3.80.0020.0354.58
4.3.70.0030.0144.63
4.3.60.0030.0244.63
4.3.50.0040.0274.63
4.3.40.0020.0324.54
4.3.30.0030.0153.33
4.3.20.0040.0153.31
4.3.10.0020.0153.27
4.3.00.0070.01315.62

preferences:
46.44 ms | 401 KiB | 5 Q