3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * make sure the setA is super set of setB */ function isSuperSet($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($setB)) { return false; } foreach ($keys as $k => $v) { if (!isSuperSet($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); return isSuperSet($setA, $setB); } $a=array(101=>array(1,2,3), 100=>array(2,3)); $b=array(101=>array(1)); 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.40.0120.00318.79
8.3.30.0070.00719.22
8.3.20.0040.00420.07
8.3.10.0050.00323.70
8.3.00.0000.00819.25
8.2.170.0140.00718.80
8.2.160.0090.00922.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00620.95
8.2.110.0100.00022.13
8.2.100.0120.00017.78
8.2.90.0040.00419.34
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0050.00318.03
8.2.50.0040.00418.07
8.2.40.0030.00620.07
8.2.30.0040.00418.25
8.2.20.0040.00417.70
8.2.10.0050.00318.15
8.2.00.0080.00017.83
8.1.270.0080.00023.84
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0030.00623.92
8.1.230.0030.00719.17
8.1.220.0080.00017.79
8.1.210.0000.00818.77
8.1.200.0030.00717.22
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0000.00818.50
8.1.160.0000.00722.13
8.1.150.0000.00718.92
8.1.140.0060.00317.49
8.1.130.0030.00317.91
8.1.120.0050.00217.40
8.1.110.0050.00217.40
8.1.100.0040.00417.51
8.1.90.0030.00517.39
8.1.80.0050.00317.54
8.1.70.0040.00417.49
8.1.60.0040.00417.54
8.1.50.0040.00417.58
8.1.40.0000.00817.63
8.1.30.0040.00417.70
8.1.20.0040.00417.72
8.1.10.0040.00417.61
8.1.00.0000.00817.46
8.0.300.0060.00318.77
8.0.290.0070.00016.88
8.0.280.0030.00318.43
8.0.270.0000.00717.31
8.0.260.0000.00817.30
8.0.250.0000.00717.00
8.0.240.0000.00816.97
8.0.230.0070.00017.01
8.0.220.0030.00316.81
8.0.210.0040.00417.00
8.0.200.0090.00016.99
8.0.190.0060.00316.96
8.0.180.0030.00916.84
8.0.170.0000.00816.98
8.0.160.0040.00416.89
8.0.150.0000.00816.77
8.0.140.0000.00816.80
8.0.130.0060.00013.38
8.0.120.0080.00016.95
8.0.110.0030.00616.98
8.0.100.0040.00416.95
8.0.90.0040.00416.87
8.0.80.0070.01516.99
8.0.70.0050.00316.98
8.0.60.0070.00016.96
8.0.50.0000.00716.89
8.0.30.0060.01617.17
8.0.20.0070.01317.40
8.0.10.0040.00417.12
8.0.00.0030.01416.99
7.4.330.0050.00015.05
7.4.320.0060.00016.65
7.4.300.0030.00316.63
7.4.290.0030.00316.55
7.4.280.0030.00616.50
7.4.270.0030.00316.55
7.4.260.0040.00416.63
7.4.250.0060.00316.58
7.4.240.0040.00316.64
7.4.230.0030.00316.62
7.4.220.0240.00616.63
7.4.210.0030.01016.54
7.4.200.0070.00016.71
7.4.160.0070.01316.41
7.4.150.0090.00917.40
7.4.140.0130.00717.86
7.4.130.0100.00616.52
7.4.120.0070.01016.66
7.4.110.0070.01016.67
7.4.100.0090.00916.66
7.4.90.0130.00516.57
7.4.80.0070.01019.39
7.4.70.0090.01216.48
7.4.60.0130.00316.41
7.4.50.0040.00416.43
7.4.40.0100.00616.55
7.4.30.0070.01016.34
7.4.00.0060.01014.86
7.3.330.0000.00613.48
7.3.320.0000.00613.43
7.3.310.0000.00716.30
7.3.300.0070.00016.36
7.3.290.0110.00316.35
7.3.280.0110.00816.36
7.3.270.0130.00517.40
7.3.260.0180.00316.47
7.3.250.0030.01716.57
7.3.240.0130.01016.72
7.3.230.0100.00716.47
7.3.210.0130.00316.41
7.3.200.0170.00319.39
7.3.190.0030.01316.54
7.3.180.0060.00916.71
7.3.170.0060.01016.51
7.3.160.0130.00616.56
7.3.10.0070.00816.65
7.3.00.0040.01216.56
7.2.330.0150.00316.91
7.2.320.0060.01616.88
7.2.310.0040.01616.59
7.2.300.0000.01716.77
7.2.290.0100.01216.85
7.2.130.0030.00916.75
7.2.120.0060.00816.85
7.2.110.0050.00817.05
7.2.100.0050.00516.85
7.2.90.0020.01116.94
7.2.80.0040.01117.08
7.2.70.0020.01116.99
7.2.60.0030.01216.95
7.2.50.0090.00617.03
7.2.40.0080.00316.91
7.2.30.0040.01117.16
7.2.20.0080.00616.94
7.2.10.0060.00716.95
7.2.00.0070.00817.85
7.1.250.0100.00315.79
7.1.200.0040.00415.74
7.1.100.0060.00617.98
7.1.70.0000.00717.16
7.1.60.0040.01819.40
7.1.50.0040.01817.00
7.1.00.0030.07722.48
7.0.200.0030.01416.84
7.0.140.0000.05022.12
7.0.60.0030.04319.96
7.0.50.0030.05317.75
7.0.40.0000.10020.11
7.0.30.0270.06720.24
7.0.20.0170.05020.05
7.0.10.0030.04320.21
7.0.00.0100.08020.15
5.6.280.0000.07721.09
5.6.210.0070.08020.63
5.6.200.0130.07018.19
5.6.190.0070.05320.45
5.6.180.0300.07720.49
5.6.170.0270.07720.52
5.6.160.0100.03720.57
5.6.150.0070.05318.27
5.6.140.0030.03718.28
5.6.130.0100.08318.19
5.6.120.0130.08321.00
5.6.110.0100.08020.99
5.6.100.0070.07020.89
5.6.90.0170.06720.98
5.6.80.0100.07320.45
5.5.350.0000.08320.37
5.5.340.0100.05717.96
5.5.330.0070.08020.35
5.5.320.0400.07320.21
5.5.310.0200.04020.19
5.5.300.0170.03717.95
5.5.290.0070.08317.97
5.5.280.0030.04020.78
5.5.270.0100.03720.89
5.5.260.0070.08320.73
5.5.250.0170.05320.55
5.5.240.0230.07320.13
5.4.450.0270.04319.20
5.4.440.0100.04019.31
5.4.430.0370.03319.39
5.4.420.0270.04019.32
5.4.410.0230.04319.33
5.4.400.0330.03018.98
5.4.390.0100.05019.06
5.4.380.0900.05018.61
5.4.370.0800.04718.68
5.4.360.0770.04718.48
5.4.350.0830.06718.76
5.4.340.0830.06018.65
5.4.320.0090.04412.51
5.4.310.0090.04912.51
5.4.300.0110.04412.51
5.4.290.0070.03712.50
5.4.280.0080.03512.40
5.4.270.0050.03612.40
5.4.260.0050.03812.41
5.4.250.0070.03612.40
5.4.240.0100.03412.40
5.4.230.0050.03812.39
5.4.220.0060.03812.39
5.4.210.0060.03512.40
5.4.200.0070.03612.39
5.4.190.0060.03612.39
5.4.180.0030.04812.39
5.4.170.0060.03612.39
5.4.160.0060.03512.39
5.4.150.0060.03612.39
5.4.140.0070.03712.07
5.4.130.0040.03812.07
5.4.120.0070.03412.02
5.4.110.0060.03412.02
5.4.100.0070.03412.02
5.4.90.0050.03712.02
5.4.80.0050.03812.02
5.4.70.0060.03512.02
5.4.60.0040.03712.02
5.4.50.0050.03612.01
5.4.40.0030.03812.00
5.4.30.0060.03712.00
5.4.20.0050.04112.00
5.4.10.0110.03012.00
5.4.00.0040.03811.49
5.3.290.0060.04012.80
5.3.280.0060.03812.71
5.3.270.0080.03712.72
5.3.260.0080.03812.72
5.3.250.0060.03712.72
5.3.240.0060.03712.72
5.3.230.0050.03912.71
5.3.220.0060.03712.68
5.3.210.0070.03812.68
5.3.200.0050.03712.68
5.3.190.0020.04112.68
5.3.180.0030.03912.68
5.3.170.0040.03812.67
5.3.160.0080.03512.67
5.3.150.0070.03712.68
5.3.140.0060.03712.66
5.3.130.0070.03912.66
5.3.120.0060.04012.66
5.3.110.0070.04212.66
5.3.100.0080.03412.13
5.3.90.0120.04212.11
5.3.80.0080.03412.10
5.3.70.0050.03712.10
5.3.60.0060.03612.09
5.3.50.0080.03312.03
5.3.40.0090.03312.03
5.3.30.0040.03711.99
5.3.20.0050.03611.78
5.3.10.0070.03311.74
5.3.00.0060.03611.73
5.2.170.0060.0299.23
5.2.160.0100.0249.22
5.2.150.0020.0339.23
5.2.140.0060.0319.22
5.2.130.0070.0279.18
5.2.120.0050.0309.18
5.2.110.0050.0409.19
5.2.100.0070.0359.18
5.2.90.0050.0299.19
5.2.80.0050.0349.18
5.2.70.0060.0369.18
5.2.60.0060.0419.14
5.2.50.0070.0279.11
5.2.40.0070.0309.09
5.2.30.0050.0309.05
5.2.20.0060.0279.05
5.2.10.0060.0268.95
5.2.00.0010.0328.82
5.1.60.0010.0268.10
5.1.50.0060.0258.10
5.1.40.0080.0308.07
5.1.30.0030.0378.42
5.1.20.0070.0348.45
5.1.10.0040.0338.17
5.1.00.0070.0328.18
5.0.50.0040.0266.67
5.0.40.0070.0246.52
5.0.30.0070.0386.34
5.0.20.0030.0266.30
5.0.10.0060.0246.28
5.0.00.0060.0366.27
4.4.90.0040.0204.78
4.4.80.0050.0194.76
4.4.70.0040.0204.75
4.4.60.0040.0184.75
4.4.50.0030.0164.77
4.4.40.0020.0274.71
4.4.30.0050.0134.76
4.4.20.0030.0164.84
4.4.10.0030.0154.85
4.4.00.0060.0244.76
4.3.110.0040.0144.67
4.3.100.0020.0154.66
4.3.90.0020.0144.63
4.3.80.0030.0234.59
4.3.70.0000.0174.63
4.3.60.0020.0154.63
4.3.50.0030.0184.63
4.3.40.0030.0324.54
4.3.30.0010.0223.32
4.3.20.0040.0173.30
4.3.10.0010.0203.26
4.3.00.0400.02015.63

preferences:
41.56 ms | 400 KiB | 5 Q