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(1=>array(2,3)); $b=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.0000.01516.63
8.3.50.0240.00722.90
8.3.40.0070.00718.89
8.3.30.0030.01019.04
8.3.20.0030.00520.21
8.3.10.0050.00223.61
8.3.00.0060.00317.50
8.2.180.0070.00716.63
8.2.170.0100.00722.96
8.2.160.0070.01020.26
8.2.150.0040.00424.18
8.2.140.0020.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00321.01
8.2.110.0060.00322.11
8.2.100.0040.00817.84
8.2.90.0080.00019.08
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0070.00017.91
8.2.30.0070.00017.97
8.2.20.0050.00317.69
8.2.10.0070.00018.22
8.2.00.0050.00217.85
8.1.280.0100.01025.92
8.1.270.0050.00323.91
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.80
8.1.230.0070.00418.95
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00717.13
8.1.190.0000.00817.23
8.1.180.0030.00518.10
8.1.170.0080.00018.52
8.1.160.0040.00422.04
8.1.150.0080.00018.93
8.1.140.0040.00417.42
8.1.130.0030.00317.91
8.1.120.0040.00417.38
8.1.110.0050.00217.39
8.1.100.0000.00717.33
8.1.90.0080.00017.39
8.1.80.0000.00717.48
8.1.70.0040.00417.36
8.1.60.0040.00417.62
8.1.50.0000.00817.56
8.1.40.0050.00317.49
8.1.30.0040.00417.54
8.1.20.0040.00417.76
8.1.10.0070.00017.56
8.1.00.0080.00017.52
8.0.300.0060.00318.77
8.0.290.0000.00816.75
8.0.280.0070.00018.36
8.0.270.0040.00417.23
8.0.260.0000.00717.34
8.0.250.0030.00317.03
8.0.240.0030.00517.05
8.0.230.0030.00316.99
8.0.220.0030.00316.92
8.0.210.0000.00716.82
8.0.200.0080.00016.92
8.0.190.0040.00417.00
8.0.180.0050.00616.96
8.0.170.0000.00816.94
8.0.160.0000.00716.96
8.0.150.0000.00716.88
8.0.140.0040.00416.80
8.0.130.0000.00613.45
8.0.120.0060.00316.88
8.0.110.0040.00416.93
8.0.100.0040.00416.71
8.0.90.0040.00416.95
8.0.80.0060.00916.88
8.0.70.0000.00816.96
8.0.60.0050.00316.88
8.0.50.0040.00416.76
8.0.30.0060.01317.25
8.0.20.0120.01417.46
8.0.10.0040.00417.05
8.0.00.0140.00516.72
7.4.330.0000.00515.01
7.4.320.0060.00016.64
7.4.300.0060.00016.52
7.4.290.0000.00716.68
7.4.280.0030.00616.66
7.4.270.0040.00416.66
7.4.260.0000.00716.55
7.4.250.0040.00416.41
7.4.240.0030.00316.61
7.4.230.0000.00716.52
7.4.220.0060.01216.52
7.4.210.0120.00816.69
7.4.200.0000.00716.34
7.4.160.0090.00616.65
7.4.150.0040.01417.40
7.4.140.0090.01017.86
7.4.130.0090.00816.55
7.4.120.0070.00916.55
7.4.110.0100.00716.67
7.4.100.0080.00816.60
7.4.90.0080.01116.63
7.4.80.0160.00319.39
7.4.70.0110.01216.70
7.4.60.0110.00516.55
7.4.50.0050.00016.44
7.4.40.0090.00616.41
7.4.30.0060.01316.50
7.4.00.0080.00814.86
7.3.330.0000.00613.21
7.3.320.0040.00413.27
7.3.310.0070.00016.38
7.3.300.0070.00016.34
7.3.290.0070.00716.27
7.3.280.0150.00216.35
7.3.270.0100.01017.40
7.3.260.0070.01116.65
7.3.250.0080.00916.47
7.3.240.0040.01416.63
7.3.230.0060.01016.49
7.3.210.0030.01316.66
7.3.200.0070.01019.39
7.3.190.0000.01616.46
7.3.180.0130.00316.35
7.3.170.0120.00616.53
7.3.160.0060.00916.43
7.3.10.0070.00816.80
7.3.00.0090.00316.35
7.2.330.0090.00916.66
7.2.320.0030.01416.51
7.2.310.0150.00616.91
7.2.300.0060.01216.82
7.2.290.0070.01016.70
7.2.130.0060.01016.87
7.2.120.0000.01716.92
7.2.110.0000.00916.93
7.2.100.0070.00316.87
7.2.90.0000.01017.07
7.2.80.0030.00916.73
7.2.70.0000.00817.02
7.2.60.0030.01016.80
7.2.50.0070.00717.02
7.2.40.0070.01016.96
7.2.30.0000.01016.95
7.2.20.0070.00717.01
7.2.10.0090.00616.86
7.2.00.0180.00818.02
7.1.250.0060.00616.02
7.1.200.0100.00315.73
7.1.100.0030.00818.02
7.1.70.0060.00817.13
7.1.60.0140.00719.40
7.1.50.0060.01916.98
7.1.00.0070.07322.30
7.0.200.0040.00416.84
7.0.140.0030.07321.95
7.0.110.0500.08319.91
7.0.100.0600.06019.96
7.0.90.0570.04319.96
7.0.80.0300.07720.01
7.0.70.0530.07720.07
7.0.60.0400.05720.09
7.0.50.0600.07019.99
7.0.40.0100.07319.66
7.0.30.0030.08019.78
7.0.20.0100.06319.64
7.0.10.0130.06319.72
7.0.00.0070.07719.74
5.6.280.0030.06720.89
5.6.260.0000.04320.70
5.6.250.0070.07720.68
5.6.240.0030.04720.57
5.6.230.0070.08720.66
5.6.220.0070.08020.85
5.6.210.0030.04320.76
5.6.200.0170.07020.64
5.6.190.0030.08720.60
5.6.180.0100.08320.72
5.6.170.0030.08720.62
5.6.160.0130.08020.59
5.6.150.0100.08020.61
5.6.140.0070.08720.54
5.6.130.0100.07720.55
5.6.120.0070.08020.59
5.6.110.0070.08020.54
5.6.100.0100.08020.67
5.6.90.0100.07020.59
5.6.80.0170.02720.02
5.6.70.0030.07320.08
5.6.60.0030.04019.99
5.6.50.0070.03719.86
5.6.40.0070.08019.98
5.6.30.0000.06320.00
5.6.20.0030.04320.06
5.6.10.0030.03720.00
5.6.00.0030.06019.97
5.5.380.0100.07317.72
5.5.370.0070.07017.63
5.5.360.0070.07717.51
5.5.350.0070.07017.68
5.5.340.0100.07018.13
5.5.330.0000.04317.93
5.5.320.0100.08317.91
5.5.310.0030.08317.91
5.5.300.0070.07317.93
5.5.290.0130.07318.27
5.5.280.0030.08017.91
5.5.270.0070.08318.13
5.5.260.0100.03718.22
5.5.250.0030.08718.03
5.5.240.0030.06717.34
5.5.230.0100.04717.52
5.5.220.0030.04717.29
5.5.210.0030.03717.52
5.5.200.0000.06017.58
5.5.190.0000.04017.57
5.5.180.0030.03717.42
5.5.160.0000.06717.43
5.5.150.0070.07717.30
5.5.140.0030.04017.32
5.5.130.0100.07317.28
5.5.120.0100.07317.61
5.5.110.0070.06017.39
5.5.100.0070.03717.39
5.5.90.0030.05717.38
5.5.80.0100.02717.13
5.5.70.0000.06317.16
5.5.60.0000.04017.07
5.5.50.0030.03717.17
5.5.40.0000.04317.36
5.5.30.0070.03717.19
5.5.20.0000.04017.29
5.5.10.0000.04017.32
5.5.00.0070.03717.19
5.4.450.0070.08019.36
5.4.440.0070.08019.55
5.4.430.0030.08319.36
5.4.420.0100.07019.50
5.4.410.0100.06319.55
5.4.400.0100.04019.25
5.4.390.0000.04319.23
5.4.380.0000.04019.09
5.4.370.0030.03719.02
5.4.360.0000.04019.02
5.4.350.0030.03719.18
5.4.340.0070.03319.11
5.4.320.0130.07319.03
5.4.310.0070.07719.18
5.4.300.0000.07318.95
5.4.290.0070.07319.02
5.4.280.0030.04719.02
5.4.270.0130.07019.22
5.4.260.0000.04019.00
5.4.250.0030.04719.01
5.4.240.0070.03719.17
5.4.230.0070.03319.17
5.4.220.0000.04019.02
5.4.210.0000.04319.32
5.4.200.0030.03719.23
5.4.190.0000.04018.96
5.4.180.0000.04019.17
5.4.170.0030.03718.97
5.4.160.0070.03318.98
5.4.150.0100.03018.98
5.4.140.0030.03316.45
5.4.130.0030.04016.58
5.4.120.0030.03316.47
5.4.110.0030.03716.46
5.4.100.0000.03716.63
5.4.90.0070.03016.70
5.4.80.0030.03316.61
5.4.70.0030.03316.52
5.4.60.0000.03716.63
5.4.50.0070.03316.29
5.4.40.0000.03716.54
5.4.30.0030.03316.33
5.4.20.0000.03016.44
5.4.10.0070.04016.35
5.4.00.0070.06015.79
5.3.290.0070.06714.80
5.3.280.0030.03714.57
5.3.270.0100.03014.59
5.3.260.0030.03714.75
5.3.250.0030.04014.63
5.3.240.0070.03314.62
5.3.230.0030.03314.61
5.3.220.0100.02314.60
5.3.210.0000.04014.43
5.3.200.0030.03714.56
5.3.190.0030.03714.53
5.3.180.0000.04014.44
5.3.170.0100.03014.61
5.3.160.0070.03314.58
5.3.150.0000.04014.55
5.3.140.0030.04014.64
5.3.130.0070.03714.53
5.3.120.0030.03714.64
5.3.110.0070.03314.68
5.3.100.0100.05314.04
5.3.90.0030.05314.04
5.3.80.0000.08313.88
5.3.70.0100.07314.05
5.3.60.0070.06714.03
5.3.50.0070.07014.06
5.3.40.0100.03714.02
5.3.30.0030.07013.93
5.3.20.0030.08313.55
5.3.10.0100.07013.76
5.3.00.0100.06713.87
5.2.170.0030.03711.16
5.2.160.0170.05311.16
5.2.150.0070.04311.13
5.2.140.0070.06011.13
5.2.130.0070.05711.07
5.2.120.0130.04711.06
5.2.110.0000.06311.11
5.2.100.0030.06011.25
5.2.90.0030.05011.09
5.2.80.0000.07011.23
5.2.70.0070.06011.33
5.2.60.0000.06311.08
5.2.50.0000.06711.02
5.2.40.0130.05010.96
5.2.30.0070.06311.04
5.2.20.0030.06310.94
5.2.10.0000.05310.95
5.2.00.0000.06310.75
5.1.60.0000.03710.26
5.1.50.0100.04710.07
5.1.40.0030.0539.91
5.1.30.0130.04310.57
5.1.20.0030.03310.45
5.1.10.0070.05010.15
5.1.00.0030.03310.14
5.0.50.0030.0339.24
5.0.40.0030.0179.24
5.0.30.0000.0639.24
5.0.20.0030.0279.24
5.0.10.0000.0479.24
5.0.00.0000.0679.24
4.4.90.0000.0379.24
4.4.80.0070.0279.24
4.4.70.0070.0279.24
4.4.60.0030.0279.24
4.4.50.0030.0339.24
4.4.40.0030.0509.24
4.4.30.0000.0279.24
4.4.20.0070.0279.24
4.4.10.0100.0279.24
4.4.00.0000.0609.24
4.3.110.0000.0339.24
4.3.100.0000.0339.24
4.3.90.0000.0339.24
4.3.80.0000.0479.24
4.3.70.0030.0239.24
4.3.60.0000.0379.24
4.3.50.0000.0379.24
4.3.40.0100.0339.24
4.3.30.0000.0379.24
4.3.20.0070.0239.24
4.3.10.0000.0409.24
4.3.00.0030.0339.24

preferences:
46.82 ms | 401 KiB | 5 Q