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,2, 100=>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.0150.00417.00
8.3.50.0210.00722.93
8.3.40.0140.00019.00
8.3.30.0100.00319.09
8.3.20.0000.00720.29
8.3.10.0040.00423.46
8.3.00.0040.00417.50
8.2.180.0040.01116.50
8.2.170.0070.01022.96
8.2.160.0070.01020.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0030.00720.95
8.2.110.0070.00322.20
8.2.100.0060.00617.91
8.2.90.0030.00519.07
8.2.80.0040.00417.97
8.2.70.0000.00817.63
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0080.00018.28
8.2.30.0080.00018.15
8.2.20.0040.00417.80
8.2.10.0070.00018.10
8.2.00.0000.00717.75
8.1.280.0100.00725.92
8.1.270.0000.00823.92
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.83
8.1.230.0040.00719.21
8.1.220.0080.00017.77
8.1.210.0040.00418.77
8.1.200.0030.00717.22
8.1.190.0050.00317.13
8.1.180.0050.00318.10
8.1.170.0040.00418.47
8.1.160.0000.00822.12
8.1.150.0000.00718.96
8.1.140.0000.00717.38
8.1.130.0030.00317.74
8.1.120.0040.00417.49
8.1.110.0050.00217.35
8.1.100.0000.00717.45
8.1.90.0080.00017.48
8.1.80.0000.00817.56
8.1.70.0040.00417.41
8.1.60.0040.00417.48
8.1.50.0040.00417.46
8.1.40.0040.00417.51
8.1.30.0080.00017.78
8.1.20.0000.00717.73
8.1.10.0000.00717.54
8.1.00.0040.00417.44
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0070.00018.48
8.0.270.0050.00317.24
8.0.260.0060.00017.15
8.0.250.0030.00316.96
8.0.240.0040.00416.87
8.0.230.0070.00016.94
8.0.220.0030.00316.95
8.0.210.0030.00516.97
8.0.200.0070.00316.99
8.0.190.0040.00416.90
8.0.180.0030.00716.98
8.0.170.0030.00517.00
8.0.160.0000.00716.83
8.0.150.0040.00416.79
8.0.140.0000.00716.82
8.0.130.0000.00613.38
8.0.120.0000.00816.92
8.0.110.0040.00416.89
8.0.100.0040.00416.86
8.0.90.0020.00516.73
8.0.80.0060.00916.86
8.0.70.0040.00416.96
8.0.60.0040.00416.75
8.0.50.0050.00216.81
8.0.30.0090.00917.12
8.0.20.0110.00917.40
8.0.10.0000.00717.00
8.0.00.0100.00716.73
7.4.330.0060.00015.02
7.4.320.0000.00716.57
7.4.300.0060.00016.64
7.4.290.0040.00416.55
7.4.280.0060.00316.49
7.4.270.0000.00716.56
7.4.260.0030.00316.54
7.4.250.0030.00516.64
7.4.240.0020.00616.58
7.4.230.0040.00416.53
7.4.220.0130.00616.58
7.4.210.0070.01016.46
7.4.200.0030.00516.73
7.4.160.0060.00916.73
7.4.150.0140.00617.40
7.4.140.0100.00717.86
7.4.130.0090.00816.51
7.4.120.0050.01216.43
7.4.110.0150.00416.57
7.4.100.0100.00616.59
7.4.90.0050.01416.61
7.4.80.0090.00919.39
7.4.70.0070.01116.70
7.4.60.0060.00916.45
7.4.50.0040.00016.44
7.4.40.0080.00816.46
7.4.30.0090.00816.71
7.4.00.0090.00615.11
7.3.330.0050.00013.28
7.3.320.0000.00713.28
7.3.310.0030.00316.41
7.3.300.0070.00016.38
7.3.290.0080.00616.32
7.3.280.0090.00816.44
7.3.270.0110.00817.40
7.3.260.0090.01016.60
7.3.250.0100.01016.52
7.3.240.0090.01216.72
7.3.230.0110.00616.60
7.3.210.0100.00716.57
7.3.200.0160.00319.39
7.3.190.0100.00716.57
7.3.180.0120.00316.52
7.3.170.0100.00716.36
7.3.160.0100.00616.43
7.3.10.0030.00916.54
7.3.00.0070.00716.50
7.2.330.0070.01116.56
7.2.320.0130.00316.88
7.2.310.0120.00916.85
7.2.300.0090.00916.60
7.2.290.0130.00316.75
7.2.130.0030.00717.04
7.2.120.0060.01017.11
7.2.110.0030.01316.57
7.2.100.0030.01316.77
7.2.90.0070.00716.72
7.2.80.0100.00317.03
7.2.70.0100.00616.73
7.2.60.0050.00917.04
7.2.50.0060.00616.98
7.2.40.0120.00316.95
7.2.30.0090.00616.75
7.2.20.0080.00816.92
7.2.10.0060.00917.04
7.2.00.0170.00818.22
7.1.250.0040.01115.96
7.1.200.0030.01015.73
7.1.100.0040.00717.76
7.1.70.0040.00417.32
7.1.60.0100.01419.40
7.1.50.0090.01616.99
7.1.00.0030.07722.40
7.0.200.0000.00816.81
7.0.140.0070.04722.07
7.0.60.0030.04020.13
7.0.50.0100.04317.95
7.0.40.0170.07320.21
7.0.30.0200.04320.17
7.0.20.0330.07720.25
7.0.10.0030.04320.24
7.0.00.0000.06020.21
5.6.280.0030.07320.89
5.6.210.0100.07020.57
5.6.200.0070.08318.16
5.6.190.0100.04020.33
5.6.180.0270.04320.45
5.6.170.0270.04020.53
5.6.160.0030.04020.47
5.6.150.0100.05018.23
5.6.140.0200.06318.17
5.6.130.0030.06718.17
5.6.120.0070.08721.13
5.6.110.0100.06020.90
5.6.100.0100.08321.09
5.6.90.0200.06721.12
5.6.80.0100.07320.54
5.5.350.0030.07720.30
5.5.340.0070.07017.97
5.5.330.0200.07320.25
5.5.320.0300.04320.26
5.5.310.0200.07020.23
5.5.300.0030.05017.98
5.5.290.0100.08717.98
5.5.280.0130.03020.88
5.5.270.0170.04320.80
5.5.260.0030.08020.87
5.5.250.0070.07020.46
5.5.240.0270.07720.38
5.4.450.0300.04719.42
5.4.440.0400.04719.22
5.4.430.0200.05019.26
5.4.420.0200.05319.46
5.4.410.1070.03319.14
5.4.400.0770.04019.00
5.4.390.0470.04719.06
5.4.380.0170.05318.60
5.4.370.0070.05718.72
5.4.360.0100.05318.48
5.4.350.0170.05718.75
5.4.340.0200.04718.68
5.4.320.0050.03812.50
5.4.310.0070.03712.50
5.4.300.0030.04112.51
5.4.290.0060.03912.50
5.4.280.0020.04012.40
5.4.270.0060.03612.41
5.4.260.0030.04112.40
5.4.250.0050.04012.41
5.4.240.0040.03712.40
5.4.230.0080.03912.39
5.4.220.0070.03612.39
5.4.210.0030.03812.40
5.4.200.0050.03812.39
5.4.190.0050.03712.39
5.4.180.0080.03612.39
5.4.170.0060.03612.40
5.4.160.0080.03412.39
5.4.150.0090.04712.39
5.4.140.0050.03812.07
5.4.130.0040.03712.06
5.4.120.0060.03812.02
5.4.110.0050.03612.02
5.4.100.0070.03512.02
5.4.90.0090.03912.02
5.4.80.0050.04112.02
5.4.70.0030.03912.01
5.4.60.0080.03912.01
5.4.50.0110.03512.02
5.4.40.0080.04112.00
5.4.30.0070.04912.00
5.4.20.0070.03512.00
5.4.10.0110.03312.00
5.4.00.0100.03211.49
5.3.290.0050.04012.80
5.3.280.0060.03812.71
5.3.270.0100.03512.72
5.3.260.0040.04112.72
5.3.250.0080.03512.72
5.3.240.0140.03012.72
5.3.230.0060.03812.71
5.3.220.0090.05112.68
5.3.210.0090.04712.68
5.3.200.0040.03812.68
5.3.190.0050.03812.68
5.3.180.0120.03612.67
5.3.170.0040.03812.66
5.3.160.0050.03712.68
5.3.150.0030.04012.67
5.3.140.0050.03712.66
5.3.130.0090.04112.66
5.3.120.0070.04312.66
5.3.110.0050.04112.66
5.3.100.0050.04012.13
5.3.90.0050.03712.11
5.3.80.0030.03912.10
5.3.70.0090.03312.10
5.3.60.0040.03812.09
5.3.50.0050.03612.03
5.3.40.0060.03612.03
5.3.30.0020.03811.99
5.3.20.0060.03411.77
5.3.10.0080.03211.73
5.3.00.0050.03611.72
5.2.170.0120.0309.22
5.2.160.0070.0279.22
5.2.150.0020.0329.22
5.2.140.0040.0319.22
5.2.130.0030.0319.18
5.2.120.0050.0289.18
5.2.110.0060.0289.19
5.2.100.0070.0269.18
5.2.90.0050.0299.18
5.2.80.0070.0299.17
5.2.70.0070.0289.18
5.2.60.0030.0329.14
5.2.50.0070.0289.11
5.2.40.0050.0289.09
5.2.30.0060.0289.05
5.2.20.0050.0289.04
5.2.10.0040.0298.95
5.2.00.0040.0308.81
5.1.60.0030.0258.10
5.1.50.0060.0238.09
5.1.40.0070.0268.07
5.1.30.0010.0298.42
5.1.20.0030.0308.45
5.1.10.0040.0268.18
5.1.00.0030.0278.18
5.0.50.0050.0196.66
5.0.40.0030.0206.52
5.0.30.0050.0366.33
5.0.20.0050.0256.30
5.0.10.0060.0266.29
5.0.00.0010.0346.28
4.4.90.0040.0144.78
4.4.80.0030.0154.75
4.4.70.0020.0164.76
4.4.60.0040.0144.75
4.4.50.0010.0174.77
4.4.40.0030.0254.71
4.4.30.0020.0234.76
4.4.20.0030.0194.85
4.4.10.0040.0144.85
4.4.00.0020.0304.76
4.3.110.0020.0164.67
4.3.100.0030.0164.66
4.3.90.0030.0144.63
4.3.80.0040.0284.59
4.3.70.0020.0194.63
4.3.60.0030.0204.62
4.3.50.0030.0264.63
4.3.40.0030.0244.54
4.3.30.0000.0183.32
4.3.20.0010.0173.30
4.3.10.0020.0153.26
4.3.00.0000.01715.62

preferences:
40.84 ms | 401 KiB | 5 Q