3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * make sure the setA and setB are the same */ function isSame($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($setA)) || (count($keys) != count($setB))) { return false; } foreach ($keys as $key) { print $key; if (!isSame($setA[$key], $setB[$key])) { 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 (!isSame($setA[$k], $v)) { return false; } } else { return false; } } return true; } $a=array(101=>array(1,2,3)); $b=array(101=>array(1,2,3)); 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.01116.63
8.3.50.0070.01422.91
8.3.40.0040.01119.00
8.3.30.0100.00619.22
8.3.20.0050.00320.16
8.3.10.0070.00023.57
8.3.00.0050.00319.25
8.2.180.0160.00025.92
8.2.170.0100.01018.91
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0030.00526.16
8.2.120.0080.00021.16
8.2.110.0030.00620.39
8.2.100.0000.01117.85
8.2.90.0030.00518.16
8.2.80.0060.00317.97
8.2.70.0060.00317.63
8.2.60.0080.00018.04
8.2.50.0090.00018.07
8.2.40.0000.00820.07
8.2.30.0070.00018.01
8.2.20.0040.00417.74
8.2.10.0030.00618.13
8.2.00.0080.00017.95
8.1.280.0110.00425.92
8.1.270.0030.00523.83
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.04
8.1.230.0070.00420.85
8.1.220.0090.00017.74
8.1.210.0060.00318.88
8.1.200.0000.01017.23
8.1.190.0000.00817.10
8.1.180.0050.00318.10
8.1.170.0000.00918.57
8.1.160.0000.00821.89
8.1.150.0080.00018.94
8.1.140.0000.00717.45
8.1.130.0040.00417.75
8.1.120.0070.00017.48
8.1.110.0070.00017.43
8.1.100.0000.00717.45
8.1.90.0040.00417.45
8.1.80.0080.00017.46
8.1.70.0000.00717.47
8.1.60.0040.00417.58
8.1.50.0000.00917.55
8.1.40.0000.00817.56
8.1.30.0000.00817.51
8.1.20.0040.00417.54
8.1.10.0060.00317.52
8.1.00.0030.00617.56
8.0.300.0040.00420.04
8.0.290.0000.00716.63
8.0.280.0080.00018.46
8.0.270.0040.00417.31
8.0.260.0000.00617.25
8.0.250.0070.00017.04
8.0.240.0040.00417.01
8.0.230.0070.00016.87
8.0.220.0070.00016.97
8.0.210.0000.00716.95
8.0.200.0070.00317.01
8.0.190.0060.00317.00
8.0.180.0030.00716.94
8.0.170.0080.00016.97
8.0.160.0050.00316.88
8.0.150.0050.00216.85
8.0.140.0000.00716.98
8.0.130.0000.00613.36
8.0.120.0000.00816.96
8.0.110.0000.00816.99
8.0.100.0040.00416.96
8.0.90.0030.00516.87
8.0.80.0160.00616.96
8.0.70.0040.00416.99
8.0.60.0040.00416.83
8.0.50.0040.00416.84
8.0.30.0050.01817.07
8.0.20.0130.00617.40
8.0.10.0000.00716.91
8.0.00.0070.01016.77
7.4.330.0050.00015.05
7.4.320.0000.00616.41
7.4.300.0040.00416.48
7.4.290.0070.00016.61
7.4.280.0070.00416.41
7.4.270.0000.00716.52
7.4.260.0040.00416.45
7.4.250.0040.00416.45
7.4.240.0000.00716.57
7.4.230.0030.00316.60
7.4.220.0090.00916.42
7.4.210.0070.00716.58
7.4.200.0030.00516.40
7.4.160.0090.00616.53
7.4.150.0100.01017.40
7.4.140.0130.00317.86
7.4.130.0050.01116.50
7.4.120.0120.00716.60
7.4.110.0190.00316.60
7.4.100.0030.01516.56
7.4.90.0090.00616.75
7.4.80.0110.00919.39
7.4.70.0090.00916.36
7.4.60.0030.01416.66
7.4.50.0000.00416.50
7.4.40.0030.01316.40
7.4.30.0080.00816.39
7.4.10.0090.00914.89
7.4.00.0070.00914.89
7.3.330.0000.00613.40
7.3.320.0000.00813.39
7.3.310.0030.00316.34
7.3.300.0000.00716.32
7.3.290.0040.01116.52
7.3.280.0100.00816.39
7.3.270.0090.00917.40
7.3.260.0090.00916.64
7.3.250.0070.01016.51
7.3.240.0130.00416.78
7.3.230.0100.00716.57
7.3.210.0120.00616.56
7.3.200.0100.01319.39
7.3.190.0130.00316.42
7.3.180.0060.00916.65
7.3.170.0100.00716.46
7.3.160.0130.00316.51
7.3.130.0100.01015.00
7.3.120.0040.01414.84
7.3.110.0100.01015.01
7.3.100.0040.01414.68
7.3.90.0030.01514.89
7.3.80.0060.00314.98
7.3.70.0110.00415.03
7.3.60.0040.00714.95
7.3.50.0140.00015.02
7.3.40.0090.00614.80
7.3.30.0060.00614.62
7.3.20.0000.01316.73
7.3.10.0060.00316.89
7.3.00.0070.00716.79
7.2.330.0060.01516.60
7.2.320.0110.01216.59
7.2.310.0080.00816.85
7.2.300.0100.00616.81
7.2.290.0060.01016.89
7.2.260.0090.00615.11
7.2.250.0040.01515.09
7.2.240.0140.00015.31
7.2.230.0040.01515.15
7.2.220.0090.00615.18
7.2.210.0070.00415.22
7.2.200.0120.00314.92
7.2.190.0060.00314.98
7.2.180.0040.01115.22
7.2.170.0000.01315.19
7.2.160.0040.00415.18
7.2.150.0030.01317.00
7.2.140.0080.00416.91
7.2.130.0040.00817.05
7.2.120.0070.00717.05
7.2.110.0100.00716.86
7.2.100.0080.00617.09
7.2.90.0000.01417.00
7.2.80.0000.01117.21
7.2.70.0090.00017.05
7.2.60.0090.00516.75
7.2.50.0000.00916.91
7.2.40.0110.00316.86
7.2.30.0060.00617.08
7.2.20.0030.00717.00
7.2.10.0060.00316.95
7.2.00.0100.00418.29
7.1.330.0100.00415.80
7.1.320.0060.00615.88
7.1.310.0090.00615.80
7.1.300.0000.01315.89
7.1.290.0000.01415.97
7.1.280.0040.01115.83
7.1.270.0070.00415.77
7.1.260.0070.00715.91
7.1.250.0040.00815.82
7.1.240.0070.00715.82
7.1.230.0030.01015.71
7.1.220.0030.00915.87
7.1.210.0080.00515.56
7.1.200.0090.00115.68
7.1.190.0100.00315.99
7.1.180.0100.00015.98
7.1.170.0110.00315.78
7.1.160.0060.00815.83
7.1.150.0030.01015.46
7.1.140.0040.00715.94
7.1.130.0070.00715.56
7.1.120.0030.00915.75
7.1.110.0040.00415.60
7.1.100.0060.00616.88
7.1.90.0040.00715.66
7.1.80.0060.01015.89
7.1.70.0010.00616.51
7.1.60.0050.01217.66
7.1.50.0100.00816.47
7.1.40.0100.00315.73
7.1.30.0090.00415.67
7.1.20.0090.00315.92
7.1.10.0040.01115.83
7.1.00.0060.04019.08
7.0.330.0060.00615.46
7.0.320.0100.00015.45
7.0.310.0040.01115.32
7.0.300.0000.00815.45
7.0.290.0030.00715.48
7.0.280.0120.00015.53
7.0.270.0030.01315.43
7.0.260.0030.00615.47
7.0.250.0040.00415.52
7.0.240.0030.01315.39
7.0.230.0000.00915.62
7.0.220.0040.00415.53
7.0.210.0000.01615.07
7.0.200.0060.00416.18
7.0.190.0070.01015.59
7.0.180.0030.00715.24
7.0.170.0040.00415.51
7.0.160.0040.01115.42
7.0.150.0030.00615.50
7.0.140.0030.04218.76
7.0.130.0030.00715.38
7.0.120.0030.01015.36
7.0.110.0030.01015.39
7.0.100.0000.01315.23
7.0.90.0000.01315.32
7.0.80.0030.01015.43
7.0.70.0000.01415.30
7.0.60.0050.04517.66
7.0.50.0080.02016.60
7.0.40.0070.04516.88
7.0.30.0170.02916.79
7.0.20.0210.04016.78
7.0.10.0120.04216.88
7.0.00.0090.04216.79
5.6.400.0060.00614.20
5.6.390.0150.00014.38
5.6.380.0040.01114.57
5.6.370.0070.00314.70
5.6.360.0030.00614.19
5.6.350.0070.01014.45
5.6.340.0030.01014.45
5.6.330.0000.01314.27
5.6.320.0090.00314.31
5.6.310.0070.00714.75
5.6.300.0040.00814.13
5.6.290.0040.01114.39
5.6.280.0080.03517.65
5.6.270.0000.01314.11
5.6.260.0000.00914.61
5.6.250.0030.01014.55
5.6.240.0000.01514.24
5.6.230.0120.00014.47
5.6.220.0030.00614.55
5.6.210.0070.03017.51
5.6.200.0080.04016.32
5.6.190.0090.02917.47
5.6.180.0170.02817.29
5.6.170.0120.03717.53
5.6.160.0060.02417.43
5.6.150.0070.02016.29
5.6.140.0060.02816.31
5.6.130.0040.03716.17
5.6.120.0080.04517.84
5.6.110.0050.04517.77
5.6.100.0090.04417.67
5.6.90.0050.03017.81
5.6.80.0020.04617.34
5.6.70.0040.00814.40
5.6.60.0070.00714.63
5.6.50.0070.00714.37
5.6.40.0030.01014.41
5.6.30.0100.00314.00
5.6.20.0030.01014.67
5.6.10.0000.00814.33
5.6.00.0040.00814.17
5.5.380.0040.01114.34
5.5.370.0140.00014.28
5.5.360.0060.00614.45
5.5.350.2170.02717.34
5.5.340.0060.04316.28
5.5.330.0040.05117.30
5.5.320.1510.02017.32
5.5.310.0220.04017.41
5.5.300.0100.04015.98
5.5.290.0050.04416.30
5.5.280.0050.04317.66
5.5.270.0030.03317.50
5.5.260.0090.04517.63
5.5.250.0110.04317.46
5.5.240.0120.03717.09
5.5.230.0030.00914.23
5.5.220.0060.00314.35
5.5.210.0030.01014.35
5.5.200.0000.01514.33
5.5.190.0040.00413.96
5.5.180.0030.01014.15
5.5.170.0100.00314.16
5.5.160.0000.01114.05
5.5.150.0050.00514.20
5.5.140.0000.00914.38
5.5.130.0040.01114.45
5.5.120.0030.01014.09
5.5.110.0030.01314.08
5.5.100.0120.00314.37
5.5.90.0030.00714.17
5.5.80.0130.00314.23
5.5.70.0000.01714.53
5.5.60.0060.00614.53
5.5.50.0030.00614.04
5.5.40.0000.01514.55
5.5.30.0140.00014.29
5.5.20.0060.00614.08
5.5.10.0030.01014.31
5.5.00.0070.00714.07
5.4.450.0350.01815.41
5.4.440.0250.02415.31
5.4.430.0150.02815.39
5.4.420.0080.02715.44
5.4.410.0130.02515.40
5.4.400.0180.02015.36
5.4.390.0090.01415.18
5.4.380.0130.03115.10
5.4.370.0100.03015.07
5.4.360.0150.02614.98
5.4.350.0120.02815.08
5.4.340.0080.03015.08
5.4.330.0040.00711.41
5.4.320.0050.02211.96
5.4.310.0060.02211.96
5.4.300.0020.02511.96
5.4.290.0040.02511.96
5.4.280.0020.02411.91
5.4.270.0070.02111.91
5.4.260.0020.02411.91
5.4.250.0080.02011.91
5.4.240.0070.02111.91
5.4.230.0070.02011.90
5.4.220.0040.02211.91
5.4.210.0040.02211.90
5.4.200.0060.01911.90
5.4.190.0050.02111.90
5.4.180.0040.02111.90
5.4.170.0060.02011.90
5.4.160.0030.02211.91
5.4.150.0020.02411.90
5.4.140.0070.01911.74
5.4.130.0060.02111.74
5.4.120.0050.02011.72
5.4.110.0030.02111.71
5.4.100.0020.02411.72
5.4.90.0050.02011.72
5.4.80.0020.02311.71
5.4.70.0070.01811.71
5.4.60.0060.01811.71
5.4.50.0040.02011.71
5.4.40.0050.02111.71
5.4.30.0050.02111.71
5.4.20.0030.02111.71
5.4.10.0060.01911.71
5.4.00.0070.01911.45
5.3.290.0110.03512.80
5.3.280.0080.03512.71
5.3.270.0100.03412.72
5.3.260.0070.03712.72
5.3.250.0110.03112.72
5.3.240.0070.03512.72
5.3.230.0050.03712.70
5.3.220.0110.03112.68
5.3.210.0080.05412.68
5.3.200.0100.03312.68
5.3.190.0010.04212.68
5.3.180.0070.03512.68
5.3.170.0050.03812.67
5.3.160.0070.03512.67
5.3.150.0030.03912.67
5.3.140.0070.03512.66
5.3.130.0070.04012.66
5.3.120.0080.03712.66
5.3.110.0050.04012.66
5.3.100.0060.03712.14
5.3.90.0060.03612.12
5.3.80.0040.03812.11
5.3.70.0040.03812.11
5.3.60.0080.03412.10
5.3.50.0060.03512.04
5.3.40.0030.03912.04
5.3.30.0070.03312.00
5.3.20.0100.03111.78
5.3.10.0060.03511.75
5.3.00.0050.03711.73
5.2.170.0090.0269.24
5.2.160.0060.0289.24
5.2.150.0050.0299.24
5.2.140.0060.0299.23
5.2.130.0070.0279.19
5.2.120.0050.0289.19
5.2.110.0030.0319.20
5.2.100.0040.0299.19
5.2.90.0020.0319.19
5.2.80.0040.0329.19
5.2.70.0040.0339.18
5.2.60.0040.0339.15
5.2.50.0040.0309.12
5.2.40.0040.0299.09
5.2.30.0040.0309.06
5.2.20.0030.0309.06
5.2.10.0050.0278.96
5.2.00.0040.0298.83
5.1.60.0040.0258.10
5.1.50.0040.0258.10
5.1.40.0060.0228.09
5.1.30.0050.0268.43
5.1.20.0030.0288.45
5.1.10.0060.0248.18
5.1.00.0070.0238.18
5.0.50.0110.0136.67
5.0.40.0040.0196.54
5.0.30.0060.0296.35
5.0.20.0020.0216.30
5.0.10.0060.0176.29
5.0.00.0030.0316.29
4.4.90.0020.0164.78
4.4.80.0030.0154.75
4.4.70.0010.0174.75
4.4.60.0030.0154.76
4.4.50.0020.0164.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0050.0144.84
4.4.10.0050.0154.85
4.4.00.0030.0254.76
4.3.110.0060.0124.67
4.3.100.0030.0154.67
4.3.90.0040.0134.63
4.3.80.0020.0254.59
4.3.70.0060.0114.63
4.3.60.0040.0134.63
4.3.50.0030.0154.63
4.3.40.0010.0264.54
4.3.30.0030.0153.33
4.3.20.0020.0163.31
4.3.10.0000.0183.27
4.3.00.0000.01715.62

preferences:
48.12 ms | 401 KiB | 5 Q