3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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); foreach ($setB as $k=>$v) { if (array_key_exists($k, $setA)) { if (!isSuperSet($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)); 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.0070.01118.29
8.3.50.0250.00322.91
8.3.40.0090.00618.96
8.3.30.0070.00719.22
8.3.20.0040.00420.12
8.3.10.0000.00823.61
8.3.00.0040.00419.25
8.2.180.0120.00316.75
8.2.170.0150.00718.94
8.2.160.0100.01022.96
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00820.91
8.2.110.0030.00620.41
8.2.100.0080.00417.97
8.2.90.0040.00419.30
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0050.00320.03
8.2.30.0000.00718.11
8.2.20.0040.00417.78
8.2.10.0040.00418.07
8.2.00.0050.00317.82
8.1.280.0150.00625.92
8.1.270.0080.00023.83
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00823.86
8.1.230.0120.00021.05
8.1.220.0050.00317.76
8.1.210.0030.00518.77
8.1.200.0090.00017.35
8.1.190.0040.00417.23
8.1.180.0080.00018.10
8.1.170.0030.00518.56
8.1.160.0000.00722.01
8.1.150.0000.00718.83
8.1.140.0040.00417.42
8.1.130.0070.00017.89
8.1.120.0030.00417.44
8.1.110.0000.00717.50
8.1.100.0040.00417.51
8.1.90.0030.00317.39
8.1.80.0070.00017.56
8.1.70.0070.00017.43
8.1.60.0060.00317.53
8.1.50.0000.00717.60
8.1.40.0040.00417.54
8.1.30.0060.00317.61
8.1.20.0040.00417.57
8.1.10.0050.00317.54
8.1.00.0000.00717.40
8.0.300.0000.00818.77
8.0.290.0060.00316.63
8.0.280.0040.00418.43
8.0.270.0030.00317.21
8.0.260.0080.00017.39
8.0.250.0030.00316.89
8.0.240.0030.00516.88
8.0.230.0030.00316.94
8.0.220.0000.00716.97
8.0.210.0050.00216.99
8.0.200.0030.00617.05
8.0.190.0000.00816.96
8.0.180.0060.00316.96
8.0.170.0050.00317.01
8.0.160.0000.00816.80
8.0.150.0030.00316.94
8.0.140.0000.00716.80
8.0.130.0000.00613.35
8.0.120.0040.00416.93
8.0.110.0090.00016.95
8.0.100.0050.00316.84
8.0.90.0050.00216.73
8.0.80.0040.01816.96
8.0.70.0050.00316.97
8.0.60.0040.00416.99
8.0.50.0070.00016.80
8.0.30.0090.00916.96
8.0.20.0100.00917.42
8.0.10.0040.00416.87
8.0.00.0050.01316.69
7.4.330.0020.00215.15
7.4.320.0000.00616.52
7.4.300.0000.00616.64
7.4.290.0030.00316.44
7.4.280.0050.00516.58
7.4.270.0050.00216.56
7.4.260.0060.00016.66
7.4.250.0000.00816.50
7.4.240.0020.00516.61
7.4.230.0030.00316.33
7.4.220.0090.00916.59
7.4.210.0120.00316.70
7.4.200.0040.00316.43
7.4.160.0160.00316.51
7.4.150.0070.01117.40
7.4.140.0080.01017.86
7.4.130.0100.01016.56
7.4.120.0070.01016.49
7.4.110.0040.01416.53
7.4.100.0170.00016.54
7.4.90.0070.01116.56
7.4.80.0100.00719.39
7.4.70.0140.00716.44
7.4.60.0080.01116.46
7.4.50.0030.00316.32
7.4.40.0160.00016.50
7.4.30.0130.00316.48
7.4.00.0040.01215.06
7.3.330.0060.00013.23
7.3.320.0060.00013.43
7.3.310.0030.00316.35
7.3.300.0030.00316.22
7.3.290.0130.00616.44
7.3.280.0110.00616.36
7.3.270.0110.00717.40
7.3.260.0070.01216.68
7.3.250.0070.01016.50
7.3.240.0100.01016.33
7.3.230.0130.00316.56
7.3.210.0060.01216.49
7.3.200.0140.00719.39
7.3.190.0130.00316.57
7.3.180.0060.00916.50
7.3.170.0030.01316.49
7.3.160.0030.01616.59
7.2.330.0160.00616.62
7.2.320.0060.01016.43
7.2.310.0060.01216.57
7.2.300.0100.00716.42
7.2.290.0110.01116.66
7.2.120.0090.00616.79
7.2.110.0000.00916.76
7.2.100.0100.00316.68
7.2.90.0040.00716.88
7.2.80.0070.00316.27
7.2.70.0040.01116.80
7.2.60.0090.00617.01
7.2.50.0060.00917.18
7.2.40.0060.00616.72
7.2.30.0040.01116.73
7.2.20.0030.01417.04
7.2.10.0080.00817.07
7.2.00.0240.01218.19
7.1.240.0030.00715.63
7.1.230.0090.00615.86
7.1.220.0000.01015.89
7.1.210.0070.00715.84
7.1.200.0090.00315.79
7.1.190.0040.00715.86
7.1.180.0040.00715.79
7.1.170.0040.00815.75
7.1.160.0060.00915.95
7.1.150.0080.00015.57
7.1.140.0000.01215.53
7.1.130.0070.00715.91
7.1.120.0060.00915.79
7.1.110.0030.01015.58
7.1.100.0040.00916.74
7.1.90.0040.00815.82
7.1.80.0090.00615.89
7.1.70.0000.01316.52
7.1.60.0080.01117.59
7.1.50.0090.00916.31
7.1.40.0100.00315.83
7.1.30.0060.00915.81
7.1.20.0090.00615.73
7.1.10.0030.01015.98
7.1.00.0040.04119.13
7.0.320.0000.01215.51
7.0.310.0000.00715.52
7.0.300.0090.00015.23
7.0.290.0030.01015.43
7.0.280.0040.00715.57
7.0.270.0060.00615.46
7.0.260.0090.00615.39
7.0.250.0060.00915.34
7.0.240.0050.00315.24
7.0.230.0100.00015.55
7.0.220.0060.00915.50
7.0.210.0030.00615.58
7.0.200.0020.01116.04
7.0.190.0070.00715.57
7.0.180.0120.00015.19
7.0.170.0070.00715.48
7.0.160.0050.00515.41
7.0.150.0000.01115.51
7.0.140.0030.02918.73
7.0.130.0040.01115.62
7.0.120.0040.01115.58
7.0.110.0020.02417.68
7.0.100.0070.02017.75
7.0.90.0070.02717.65
7.0.80.0030.03317.65
7.0.70.0190.03917.70
7.0.60.0280.04317.80
7.0.50.0290.03517.83
7.0.40.0080.04116.60
7.0.30.0050.03016.74
7.0.20.0030.04716.45
7.0.10.0030.03916.61
7.0.00.0000.03816.56
5.6.380.0070.00314.59
5.6.370.0060.00914.09
5.6.360.0090.00314.71
5.6.350.0060.00914.26
5.6.340.0060.00614.70
5.6.330.0120.00314.58
5.6.320.0040.00714.14
5.6.310.0110.00314.22
5.6.300.0070.00314.48
5.6.290.0030.00914.58
5.6.280.0070.03417.73
5.6.270.0040.00714.09
5.6.260.0080.03017.58
5.6.250.0130.03717.65
5.6.240.0120.02717.50
5.6.230.0030.02617.51
5.6.220.0070.03817.53
5.6.210.0080.03517.48
5.6.200.0050.02617.57
5.6.190.0030.04617.56
5.6.180.0040.02317.40
5.6.170.0020.03417.60
5.6.160.0100.02817.55
5.6.150.0050.03617.49
5.6.140.0050.04217.41
5.6.130.0050.02717.48
5.6.120.0040.03217.46
5.6.110.0120.03217.52
5.6.100.0070.03317.60
5.6.90.0030.02817.56
5.6.80.0060.03917.18
5.6.70.0120.01717.24
5.6.60.0060.03017.22
5.6.50.0050.03117.36
5.6.40.0070.01917.25
5.6.30.0000.02817.20
5.6.20.0050.02916.95
5.6.10.0050.04517.26
5.6.00.0000.03117.19
5.5.380.0000.02514.41
5.5.370.0070.03214.31
5.5.360.0070.03714.56
5.5.350.0050.04314.41
5.5.340.0050.04014.49
5.5.330.0050.02414.66
5.5.320.0040.02414.68
5.5.310.0070.03214.63
5.5.300.0040.02814.56
5.5.290.0030.02414.82
5.5.280.0040.04014.51
5.5.270.0020.02914.50
5.5.260.0070.02114.56
5.5.250.0030.04314.54
5.5.240.0030.02414.39
5.5.230.0030.03714.19
5.5.220.0010.02114.35
5.5.210.0000.04014.33
5.5.200.0050.01814.34
5.5.190.0020.02414.36
5.5.180.0080.03514.45
5.5.170.0030.01014.05
5.5.160.0070.03514.31
5.5.150.0040.03714.27
5.5.140.0030.03214.26
5.5.130.0030.04214.17
5.5.120.0050.03014.32
5.5.110.0080.02114.41
5.5.100.0040.03114.30
5.5.90.0070.04014.20
5.5.80.0010.02414.29
5.5.70.0090.03114.32
5.5.60.0090.02114.17
5.5.50.0020.04214.28
5.5.40.0050.02514.12
5.5.30.0050.04314.35
5.5.20.0020.04414.16
5.5.10.0080.02814.18
5.5.00.0070.03714.18
5.4.450.0070.04015.35
5.4.440.0030.04715.20
5.4.430.0050.04115.37
5.4.420.0070.03915.42
5.4.410.0050.04215.25
5.4.400.0070.03215.18
5.4.390.0030.02315.04
5.4.380.0000.02915.16
5.4.370.0110.03515.16
5.4.360.0020.03415.15
5.4.350.0040.02415.08
5.4.340.0050.02315.21
5.4.330.0000.01011.07
5.4.320.0070.03815.22
5.4.310.0030.03515.13
5.4.300.0080.01815.21
5.4.290.0070.04015.20
5.4.280.0140.01815.05
5.4.270.0050.02815.24
5.4.260.0020.01915.03
5.4.250.0080.02315.03
5.4.240.0020.02315.21
5.4.230.0020.03515.19
5.4.220.0070.04315.18
5.4.210.0060.03115.16
5.4.200.0050.03815.14
5.4.190.0070.04315.24
5.4.180.0090.03115.19
5.4.170.0020.03615.04
5.4.160.0060.02315.00
5.4.150.0090.03515.03
5.4.140.0050.03313.86
5.4.130.0110.01813.85
5.4.120.0100.03013.76
5.4.110.0070.03113.90
5.4.100.0070.03513.84
5.4.90.0040.03713.79
5.4.80.0080.03513.74
5.4.70.0050.02713.88
5.4.60.0050.02813.82
5.4.50.0090.02513.85
5.4.40.0070.03713.88
5.4.30.0050.03813.89
5.4.20.0080.03513.77
5.4.10.0080.03613.81
5.4.00.0050.03413.44
5.3.290.0030.02012.87
5.3.280.0100.02112.91
5.3.270.0050.04012.86
5.3.260.0000.02812.82
5.3.250.0050.03012.77
5.3.240.0070.02012.86
5.3.230.0060.01812.88
5.3.220.0080.03312.82
5.3.210.0050.03112.83
5.3.200.0120.03312.83
5.3.190.0080.03612.87
5.3.180.0080.04212.86
5.3.170.0030.02312.89
5.3.160.0100.02812.81
5.3.150.0030.02712.84
5.3.140.0080.03712.83
5.3.130.0050.03912.75
5.3.120.0050.03912.93
5.3.110.0030.02412.85
5.3.100.0100.01812.63
5.3.90.0050.03312.56
5.3.80.0090.03312.55
5.3.70.0020.04012.55
5.3.60.0020.02912.54
5.3.50.0070.03612.52
5.3.40.0050.02112.63
5.3.30.0100.03712.56
5.3.20.0090.03512.39
5.3.10.0070.03312.36
5.3.00.0060.02312.37
5.2.170.0060.02112.00
5.2.160.0060.02812.00
5.2.150.0030.03312.00
5.2.140.0060.02812.00
5.2.130.0070.03112.00
5.2.120.0020.02112.00
5.2.110.0070.02012.00
5.2.100.0050.02212.00
5.2.90.0020.02112.00
5.2.80.0060.03312.00
5.2.70.0030.02112.00
5.2.60.0050.03112.00
5.2.50.0050.01712.00
5.2.40.0020.03112.00
5.2.30.0050.01812.00
5.2.20.0090.02612.00
5.2.10.0080.01712.00
5.2.00.0070.01512.00
5.1.60.0090.01812.00
5.1.50.0020.02112.00
5.1.40.0050.01712.00
5.1.30.0030.01712.00
5.1.20.0030.03212.00
5.1.10.0060.03012.00
5.1.00.0070.02012.00
5.0.50.0030.01312.00
5.0.40.0030.01312.00
5.0.30.0000.01912.00
5.0.20.0050.01312.00
5.0.10.0010.02512.00
5.0.00.0080.01512.00
4.4.90.0030.00812.00
4.4.80.0000.01112.00
4.4.70.0000.02212.00
4.4.60.0030.01712.00
4.4.50.0010.01012.00
4.4.40.0010.02312.00
4.4.30.0030.02012.00
4.4.20.0060.01012.00
4.4.10.0050.01712.00
4.4.00.0020.02012.00
4.3.110.0050.01012.00
4.3.100.0000.01512.00
4.3.90.0030.01312.00
4.3.80.0000.02412.00
4.3.70.0030.01712.00
4.3.60.0030.01012.00
4.3.50.0020.01912.00
4.3.40.0030.02812.00
4.3.30.0010.01312.00
4.3.20.0020.00912.00
4.3.10.0000.01312.00
4.3.00.0010.01912.00

preferences:
45.69 ms | 401 KiB | 5 Q