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(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.01016.74
8.3.50.0220.00822.77
8.3.40.0070.01418.67
8.3.30.0070.00719.02
8.3.20.0030.00620.29
8.3.10.0040.00423.68
8.3.00.0080.00017.34
8.2.180.0160.00618.29
8.2.170.0100.00722.96
8.2.160.0100.01020.23
8.2.150.0030.00524.18
8.2.140.0000.00724.66
8.2.130.0000.00826.16
8.2.120.0040.00421.05
8.2.110.0000.01122.17
8.2.100.0090.00317.78
8.2.90.0040.00419.09
8.2.80.0040.00417.97
8.2.70.0000.00817.38
8.2.60.0000.00817.80
8.2.50.0030.00618.07
8.2.40.0030.00519.79
8.2.30.0040.00417.98
8.2.20.0080.00017.72
8.2.10.0000.00718.22
8.2.00.0020.00517.79
8.1.280.0140.00325.92
8.1.270.0000.00823.88
8.1.260.0000.00826.35
8.1.250.0110.00328.09
8.1.240.0060.00323.98
8.1.230.0040.00719.18
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0030.00717.36
8.1.190.0040.00417.10
8.1.180.0040.00418.10
8.1.170.0060.00318.64
8.1.160.0000.00722.04
8.1.150.0000.00718.83
8.1.140.0000.00717.41
8.1.130.0000.00717.75
8.1.120.0030.00517.54
8.1.110.0000.00717.38
8.1.100.0040.00417.49
8.1.90.0000.00817.44
8.1.80.0020.00517.43
8.1.70.0050.00217.43
8.1.60.0090.00017.52
8.1.50.0000.00817.45
8.1.40.0000.00717.48
8.1.30.0000.00817.68
8.1.20.0030.00517.70
8.1.10.0000.00817.48
8.1.00.0000.00717.52
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0000.00718.50
8.0.270.0030.00317.35
8.0.260.0030.00317.30
8.0.250.0030.00316.96
8.0.240.0070.00016.97
8.0.230.0000.00716.90
8.0.220.0070.00016.93
8.0.210.0040.00416.89
8.0.200.0050.00516.98
8.0.190.0000.00716.98
8.0.180.0000.01216.86
8.0.170.0040.00416.86
8.0.160.0050.00316.89
8.0.150.0070.00016.88
8.0.140.0070.00016.93
8.0.130.0060.00013.36
8.0.120.0000.00716.78
8.0.110.0040.00416.88
8.0.100.0040.00416.86
8.0.90.0000.00716.71
8.0.80.0080.00816.96
8.0.70.0040.00416.91
8.0.60.0000.00716.98
8.0.50.0000.00716.96
8.0.30.0120.01017.18
8.0.20.0120.01217.40
8.0.10.0000.00716.96
8.0.00.0100.00716.72
7.4.330.0000.00515.00
7.4.320.0000.00616.63
7.4.300.0060.00016.64
7.4.290.0030.00316.55
7.4.280.0030.00616.63
7.4.270.0000.00716.57
7.4.260.0030.00316.66
7.4.250.0080.00016.61
7.4.240.0020.00516.63
7.4.230.0030.00316.44
7.4.220.0090.01616.46
7.4.210.0060.01316.62
7.4.200.0040.00416.68
7.4.160.0160.00416.45
7.4.150.0130.00417.40
7.4.140.0140.00717.86
7.4.130.0090.00916.71
7.4.120.0100.00916.66
7.4.110.0090.00816.59
7.4.100.0100.00716.54
7.4.90.0090.00916.48
7.4.80.0100.01019.39
7.4.70.0050.01816.55
7.4.60.0080.00816.55
7.4.50.0040.00416.34
7.4.40.0080.00816.55
7.4.30.0120.00616.63
7.4.00.0060.01015.05
7.3.330.0000.00613.21
7.3.320.0030.00313.40
7.3.310.0050.00216.37
7.3.300.0050.00216.35
7.3.290.0000.01316.37
7.3.280.0090.00916.32
7.3.270.0150.00917.40
7.3.260.0190.02216.43
7.3.250.0100.00716.56
7.3.240.0100.01016.39
7.3.230.0100.00716.39
7.3.210.0090.00916.46
7.3.200.0110.00719.39
7.3.190.0080.00816.31
7.3.180.0030.01216.43
7.3.170.0090.00616.41
7.3.160.0160.00316.56
7.3.120.0000.02015.08
7.3.110.0090.00914.88
7.3.100.0040.01114.90
7.3.90.0000.01415.04
7.3.80.0070.00714.64
7.3.70.0070.00715.01
7.3.60.0060.00914.78
7.3.50.0070.01014.78
7.3.40.0070.00414.74
7.3.30.0080.00414.82
7.3.20.0060.00916.69
7.3.10.0060.00916.49
7.3.00.0040.00916.40
7.2.330.0060.01516.68
7.2.320.0100.00616.50
7.2.310.0090.01316.82
7.2.300.0160.00016.74
7.2.290.0100.00716.64
7.2.250.0070.01415.39
7.2.240.0070.01415.36
7.2.230.0030.01315.19
7.2.220.0060.00915.23
7.2.210.0060.00914.88
7.2.200.0060.00615.01
7.2.190.0070.00715.05
7.2.180.0040.01415.13
7.2.170.0000.01415.08
7.2.60.0030.00616.98
7.1.330.0040.01115.96
7.1.320.0060.00615.87
7.1.310.0110.00315.80
7.1.300.0100.00715.56
7.1.290.0060.00615.44
7.1.280.0030.00615.60
7.1.270.0030.00915.51
7.1.260.0030.01315.54
7.1.200.0000.01215.89
7.1.100.0160.00316.29
7.1.70.0050.00316.87
7.1.60.0070.01419.40
7.1.50.0030.01717.04
7.1.00.0070.07322.36
7.0.200.0080.00016.79
7.0.140.0000.05021.92
7.0.60.0070.08319.97
7.0.50.0100.05317.98
7.0.40.0070.04020.30
7.0.30.0300.07320.32
7.0.20.0170.08320.03
7.0.10.0030.04720.08
7.0.00.0100.07020.23
5.6.280.0070.06721.02
5.6.210.0100.03720.45
5.6.200.0070.05718.29
5.6.190.0030.04320.68
5.6.180.0130.04720.57
5.6.170.0330.05720.44
5.6.160.0030.07020.56
5.6.150.0070.06018.23
5.6.140.0030.04718.17
5.6.130.0030.08318.12
5.6.120.0000.04320.98
5.6.110.0070.04021.15
5.6.100.0130.05020.99
5.6.90.0030.06321.03
5.6.80.0130.07720.40
5.5.350.0030.06720.39
5.5.340.0100.07718.02
5.5.330.0070.05020.30
5.5.320.0430.07020.27
5.5.310.0270.06320.27
5.5.300.0030.04018.07
5.5.290.0070.04017.94
5.5.280.0070.08020.89
5.5.270.0100.07320.77
5.5.260.0070.08020.77
5.5.250.0100.05320.66
5.5.240.0300.07020.22
5.4.450.0330.04319.29
5.4.440.0400.04019.57
5.4.430.0130.04019.19
5.4.420.0570.04319.52
5.4.410.0370.05319.29
5.4.400.0500.04319.14
5.4.390.0200.05019.24
5.4.380.0170.05018.75
5.4.370.0130.05318.53
5.4.360.0100.05718.75
5.4.350.0070.06018.73
5.4.340.0100.05718.74
5.4.320.0080.03512.51
5.4.310.0070.03712.50
5.4.300.0070.03512.51
5.4.290.0050.03812.51
5.4.280.0060.03512.40
5.4.270.0080.03312.41
5.4.260.0060.03912.40
5.4.250.0060.04712.40
5.4.240.0050.03912.40
5.4.230.0070.03712.39
5.4.220.0060.03712.39
5.4.210.0100.04412.39
5.4.200.0080.04212.40
5.4.190.0040.03812.39
5.4.180.0070.03812.39
5.4.170.0080.03812.40
5.4.160.0050.03612.40
5.4.150.0060.03612.39
5.4.140.0060.05412.08
5.4.130.0040.03812.07
5.4.120.0120.04312.02
5.4.110.0050.04212.01
5.4.100.0050.03612.01
5.4.90.0100.04912.02
5.4.80.0080.04912.02
5.4.70.0050.04812.01
5.4.60.0090.04212.01
5.4.50.0070.03512.01
5.4.40.0050.03512.00
5.4.30.0060.03612.00
5.4.20.0080.03312.00
5.4.10.0050.03612.00
5.4.00.0080.03511.48
5.3.290.0090.04712.80
5.3.280.0070.04612.71
5.3.270.0030.04212.72
5.3.260.0060.03912.72
5.3.250.0030.04112.72
5.3.240.0080.03612.72
5.3.230.0140.03012.71
5.3.220.0060.03712.68
5.3.210.0080.03712.68
5.3.200.0100.03612.68
5.3.190.0100.04812.68
5.3.180.0060.03712.68
5.3.170.0080.03512.67
5.3.160.0060.03612.67
5.3.150.0050.04212.67
5.3.140.0070.04012.66
5.3.130.0080.03712.66
5.3.120.0070.03912.65
5.3.110.0040.04112.66
5.3.100.0070.03612.13
5.3.90.0090.03512.11
5.3.80.0070.05012.10
5.3.70.0070.05012.10
5.3.60.0080.04612.09
5.3.50.0080.04512.03
5.3.40.0060.04212.03
5.3.30.0060.04712.00
5.3.20.0080.04911.77
5.3.10.0100.04811.73
5.3.00.0130.04611.72
5.2.170.0040.0319.23
5.2.160.0070.0289.22
5.2.150.0040.0339.22
5.2.140.0080.0319.22
5.2.130.0050.0299.18
5.2.120.0060.0289.18
5.2.110.0060.0279.19
5.2.100.0020.0309.18
5.2.90.0050.0299.19
5.2.80.0030.0329.18
5.2.70.0070.0299.18
5.2.60.0050.0299.14
5.2.50.0030.0319.11
5.2.40.0040.0299.09
5.2.30.0030.0319.05
5.2.20.0030.0319.04
5.2.10.0070.0288.95
5.2.00.0060.0288.81
5.1.60.0040.0248.11
5.1.50.0010.0288.10
5.1.40.0080.0208.07
5.1.30.0070.0238.42
5.1.20.0060.0248.45
5.1.10.0060.0238.17
5.1.00.0060.0248.18
5.0.50.0030.0216.66
5.0.40.0030.0206.52
5.0.30.0030.0356.34
5.0.20.0040.0246.30
5.0.10.0020.0206.28
5.0.00.0050.0366.28
4.4.90.0020.0164.78
4.4.80.0040.0184.75
4.4.70.0020.0164.76
4.4.60.0020.0164.75
4.4.50.0030.0144.77
4.4.40.0030.0254.71
4.4.30.0020.0164.75
4.4.20.0030.0154.85
4.4.10.0040.0174.84
4.4.00.0030.0264.75
4.3.110.0010.0174.67
4.3.100.0020.0154.66
4.3.90.0020.0154.63
4.3.80.0020.0254.58
4.3.70.0030.0144.63
4.3.60.0020.0154.63
4.3.50.0030.0164.63
4.3.40.0030.0244.54
4.3.30.0030.0153.32
4.3.20.0030.0153.31
4.3.10.0040.0133.26
4.3.00.0030.01715.62

preferences:
41.5 ms | 401 KiB | 5 Q