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; } var_dump($keys); foreach ($keys as $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.0060.01316.75
8.3.50.0150.00522.88
8.3.40.0060.00918.62
8.3.30.0120.00319.21
8.3.20.0040.00420.16
8.3.10.0080.00023.70
8.3.00.0040.00419.25
8.2.180.0110.00416.63
8.2.170.0100.00722.96
8.2.160.0100.01020.35
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0140.00326.16
8.2.120.0080.00019.61
8.2.110.0030.00720.37
8.2.100.0090.00317.85
8.2.90.0030.00618.22
8.2.80.0050.00317.97
8.2.70.0080.00017.75
8.2.60.0030.00518.04
8.2.50.0030.00618.07
8.2.40.0050.00320.01
8.2.30.0050.00218.05
8.2.20.0080.00017.81
8.2.10.0080.00018.00
8.2.00.0000.00717.81
8.1.280.0100.01025.92
8.1.270.0050.00323.99
8.1.260.0120.00326.35
8.1.250.0050.00228.09
8.1.240.0030.00622.02
8.1.230.0080.00320.79
8.1.220.0040.00417.79
8.1.210.0000.00818.85
8.1.200.0040.00417.10
8.1.190.0040.00417.00
8.1.180.0040.00418.10
8.1.170.0040.00418.64
8.1.160.0050.00321.98
8.1.150.0050.00318.88
8.1.140.0040.00417.52
8.1.130.0040.00417.84
8.1.120.0040.00417.46
8.1.110.0000.00717.43
8.1.100.0070.00017.36
8.1.90.0050.00317.43
8.1.80.0050.00217.36
8.1.70.0040.00417.43
8.1.60.0030.00617.49
8.1.50.0000.00917.53
8.1.40.0040.00417.52
8.1.30.0050.00317.70
8.1.20.0050.00217.51
8.1.10.0040.00417.51
8.1.00.0030.00517.56
8.0.300.0040.00419.89
8.0.290.0040.00416.88
8.0.280.0040.00418.45
8.0.270.0070.00017.19
8.0.260.0060.00017.20
8.0.250.0070.00016.93
8.0.240.0040.00417.04
8.0.230.0000.00716.91
8.0.220.0070.00016.97
8.0.210.0000.00717.00
8.0.200.0030.00717.00
8.0.190.0000.00816.93
8.0.180.0000.00817.00
8.0.170.0000.00717.01
8.0.160.0040.00417.07
8.0.150.0070.00016.85
8.0.140.0040.00416.95
8.0.130.0060.00013.35
8.0.120.0040.00416.86
8.0.110.0000.00716.93
8.0.100.0000.00816.82
8.0.90.0030.00517.01
8.0.80.0130.00916.87
8.0.70.0000.00816.96
8.0.60.0000.00716.83
8.0.50.0040.00416.82
8.0.30.0150.00417.15
8.0.20.0130.00717.40
8.0.10.0050.00216.96
8.0.00.0110.00716.89
7.4.330.0020.00215.09
7.4.320.0000.00616.58
7.4.300.0000.00616.61
7.4.290.0040.00416.55
7.4.280.0060.00616.51
7.4.270.0030.00316.53
7.4.260.0030.00316.48
7.4.250.0000.00816.44
7.4.240.0040.00416.55
7.4.230.0030.00316.54
7.4.220.0130.00616.57
7.4.210.0140.00616.50
7.4.200.0030.00416.41
7.4.160.0070.01016.72
7.4.150.0100.01017.40
7.4.140.0080.00917.86
7.4.130.0110.00916.56
7.4.120.0080.00916.54
7.4.110.0170.00716.64
7.4.100.0090.01216.67
7.4.90.0060.01416.54
7.4.80.0090.00919.39
7.4.70.0190.01016.48
7.4.60.0120.00616.53
7.4.50.0080.00016.39
7.4.40.0110.00516.71
7.4.30.0060.00916.47
7.4.10.0030.01714.79
7.4.00.0060.01014.80
7.3.330.0000.00613.45
7.3.320.0030.00313.29
7.3.310.0030.00316.39
7.3.300.0070.00016.30
7.3.290.0100.01016.53
7.3.280.0060.00916.47
7.3.270.0060.01217.40
7.3.260.0090.00916.68
7.3.250.0120.00616.50
7.3.240.0140.01016.62
7.3.230.0120.00416.50
7.3.210.0080.00916.42
7.3.200.0100.01319.39
7.3.190.0150.00716.48
7.3.180.0090.00616.47
7.3.170.0090.01216.31
7.3.160.0000.02016.64
7.3.130.0060.01214.68
7.3.120.0030.01314.78
7.3.110.0050.01014.73
7.3.100.0070.00814.88
7.3.90.0090.00614.63
7.3.80.0070.00414.87
7.3.70.0070.00714.79
7.3.60.0030.00714.79
7.3.50.0070.00614.72
7.3.40.0080.00614.66
7.3.30.0080.00314.78
7.3.20.0110.00216.51
7.3.10.0040.00916.64
7.3.00.0040.00616.68
7.2.330.0060.01216.79
7.2.320.0130.00916.89
7.2.310.0100.01416.67
7.2.300.0000.01716.54
7.2.290.0110.00616.91
7.2.260.0000.01914.96
7.2.250.0080.01115.04
7.2.240.0090.00815.02
7.2.230.0050.00914.81
7.2.220.0060.00715.08
7.2.210.0030.00814.94
7.2.200.0020.01214.95
7.2.190.0060.00914.81
7.2.180.0070.00714.88
7.2.170.0060.00414.86
7.2.160.0020.01114.92
7.2.150.0050.01116.85
7.2.140.0070.00916.80
7.2.130.0080.00316.75
7.2.120.0050.00716.93
7.2.110.0090.00516.88
7.2.100.0050.01016.88
7.2.90.0060.00716.77
7.2.80.0100.00316.69
7.2.70.0070.00716.81
7.2.60.0030.01216.94
7.2.50.0090.00216.98
7.2.40.0020.01116.87
7.2.30.0080.00817.00
7.2.20.0070.00516.81
7.2.10.0080.00616.82
7.2.00.0060.01016.76
7.1.330.0030.01115.68
7.1.320.0060.00615.71
7.1.310.0060.00415.83
7.1.300.0040.00815.66
7.1.290.0050.00715.64
7.1.280.0040.00815.66
7.1.270.0020.01115.88
7.1.260.0070.00615.73
7.1.250.0060.00415.55
7.1.240.0030.00615.70
7.1.230.0110.00315.75
7.1.220.0070.00415.50
7.1.210.0100.00015.37
7.1.200.0070.00515.76
7.1.190.0030.01415.59
7.1.180.0060.00315.89
7.1.170.0000.01115.74
7.1.160.0030.01015.53
7.1.150.0060.00915.86
7.1.140.0000.01415.49
7.1.130.0090.00315.54
7.1.120.0040.01115.87
7.1.110.0000.00915.77
7.1.100.0040.00715.71
7.1.90.0060.00915.84
7.1.80.0000.01415.51
7.1.70.0020.01016.43
7.1.60.0080.01117.58
7.1.50.0090.01116.54
7.1.40.0060.00615.82
7.1.30.0120.00015.59
7.1.20.0030.00915.81
7.1.10.0070.00815.56
7.1.00.0070.04018.92
7.0.330.0000.01415.15
7.0.320.0070.00715.36
7.0.310.0120.00615.48
7.0.300.0000.01215.44
7.0.290.0070.00715.42
7.0.280.0110.00615.40
7.0.270.0040.00815.27
7.0.260.0030.01015.39
7.0.250.0060.00915.47
7.0.240.0060.00315.21
7.0.230.0110.00315.37
7.0.220.0040.01115.13
7.0.210.0000.01515.46
7.0.200.0070.00516.14
7.0.190.0070.00715.47
7.0.180.0000.00915.34
7.0.170.0040.00815.42
7.0.160.0070.00715.34
7.0.150.0030.00715.54
7.0.140.0030.04018.67
7.0.130.0040.01115.18
7.0.120.0090.00315.55
7.0.110.0090.00315.33
7.0.100.0040.00815.41
7.0.90.0000.01215.25
7.0.80.0000.00915.57
7.0.70.0060.00315.31
7.0.60.0070.04717.71
7.0.50.0050.02516.72
7.0.40.0080.04216.84
7.0.30.0360.03816.87
7.0.20.0160.04416.75
7.0.10.0100.04516.79
7.0.00.0050.04216.94
5.6.400.0060.00614.55
5.6.390.0000.01214.24
5.6.380.0050.00314.12
5.6.370.0080.01114.46
5.6.360.0070.00714.29
5.6.350.0100.00713.99
5.6.340.0090.00914.37
5.6.330.0040.00814.41
5.6.320.0000.00914.26
5.6.310.0040.00814.57
5.6.300.0100.00014.23
5.6.290.0060.00614.29
5.6.280.0050.04117.57
5.6.270.0000.00914.47
5.6.260.0070.00714.40
5.6.250.0030.00614.23
5.6.240.0030.00914.44
5.6.230.0080.00814.30
5.6.220.0040.00814.34
5.6.210.0120.04117.51
5.6.200.0090.03716.41
5.6.190.0070.03917.49
5.6.180.0170.04217.49
5.6.170.0170.04217.33
5.6.160.0060.04317.50
5.6.150.0070.04216.41
5.6.140.0080.04316.24
5.6.130.0080.03916.34
5.6.120.0070.04117.69
5.6.110.0150.04117.70
5.6.100.0070.04717.54
5.6.90.0050.04717.66
5.6.80.0150.03817.25
5.6.70.0040.01214.53
5.6.60.0040.01114.27
5.6.50.0080.00414.10
5.6.40.0040.01414.16
5.6.30.0030.01314.43
5.6.20.0030.01214.19
5.6.10.0060.01014.55
5.6.00.0080.00814.38
5.5.380.0090.00613.87
5.5.370.0110.00713.79
5.5.360.0170.00013.97
5.5.350.0020.04717.23
5.5.340.0090.04116.05
5.5.330.0120.03717.32
5.5.320.0090.03517.29
5.5.310.0260.03617.01
5.5.300.0080.04116.18
5.5.290.0070.04816.21
5.5.280.0080.03717.70
5.5.270.0130.04217.50
5.5.260.0100.02317.46
5.5.250.0110.02317.48
5.5.240.1920.02217.20
5.5.230.0130.00814.49
5.5.220.0080.01214.10
5.5.210.0110.00714.48
5.5.200.0060.00914.15
5.5.190.0050.01614.34
5.5.180.0090.00914.41
5.5.170.0160.00714.43
5.5.160.0000.01313.87
5.5.150.0070.00714.20
5.5.140.0040.00814.02
5.5.130.0040.01114.49
5.5.120.0110.00714.25
5.5.110.0110.00714.14
5.5.100.0000.01613.83
5.5.90.0070.00713.89
5.5.80.0070.00714.25
5.5.70.0120.00313.96
5.5.60.0030.01013.97
5.5.50.0070.00314.35
5.5.40.0030.00913.89
5.5.30.0040.00714.24
5.5.20.0030.00613.99
5.5.10.0070.00714.44
5.5.00.0000.01314.38
5.4.450.0960.02015.39
5.4.440.0870.02015.45
5.4.430.0830.02415.21
5.4.420.0900.02115.44
5.4.410.0880.02215.28
5.4.400.1000.02314.79
5.4.390.0860.01614.95
5.4.380.0920.02314.98
5.4.370.0800.02115.00
5.4.360.0770.02215.09
5.4.350.0850.02015.06
5.4.340.0200.02914.96
5.4.330.0070.00711.00
5.4.320.0000.02715.02
5.4.310.0070.03515.01
5.4.300.0280.02215.08
5.4.290.0770.02514.85
5.4.280.0150.03715.08
5.4.270.0050.02414.86
5.4.260.0020.02715.05
5.4.250.0310.02114.82
5.4.240.0860.02014.90
5.4.230.0830.02214.74
5.4.220.0770.02314.94
5.4.210.0720.02315.05
5.4.200.0910.02015.28
5.4.190.0830.01814.93
5.4.180.0870.02715.22
5.4.170.0910.01815.08
5.4.160.0900.02614.84
5.4.150.0800.01814.91
5.4.140.0980.02013.75
5.4.130.0900.02313.75
5.4.120.0860.02613.67
5.4.110.0920.03313.75
5.4.100.0900.02513.75
5.4.90.0870.02513.76
5.4.80.0910.02013.85
5.4.70.0890.02413.64
5.4.60.0890.02413.79
5.4.50.0900.02413.84
5.4.40.0840.02013.66
5.4.30.0870.02613.66
5.4.20.0750.02213.64
5.4.10.0950.02413.60
5.4.00.0820.02413.32
5.3.290.1770.04714.66
5.3.280.1730.05014.52
5.3.270.1800.04314.87
5.3.260.1500.04314.63
5.3.250.1530.04014.64
5.3.240.1670.04714.55
5.3.230.1630.05014.70
5.3.220.1670.04014.66
5.3.210.1730.04014.51
5.3.200.1570.04014.67
5.3.190.1370.05014.52
5.3.180.0000.05314.59
5.3.170.0030.03714.57
5.3.160.1070.05314.50
5.3.150.0270.03314.80
5.3.140.0000.04014.72
5.3.130.0000.04014.63
5.3.120.0430.03714.54
5.3.110.1600.03714.65
5.3.100.2030.03714.11
5.3.90.1770.03714.12
5.3.80.1470.03313.96
5.3.70.1570.03714.07
5.3.60.1500.03014.04
5.3.50.1570.03313.88
5.3.40.1430.03313.95
5.3.30.1570.03714.07
5.3.20.1300.03313.79
5.3.10.0070.04713.60
5.3.00.0000.04013.82
5.2.170.0530.03011.25
5.2.160.1230.02011.26
5.2.150.1300.03011.26
5.2.140.1170.03711.10
5.2.130.1270.03011.02
5.2.120.1230.02311.20
5.2.110.1230.02311.04
5.2.100.1230.03011.26
5.2.90.1270.02311.03
5.2.80.1230.04011.25
5.2.70.1530.03711.04
5.2.60.1300.03010.98
5.2.50.1070.03010.99
5.2.40.1000.03011.09
5.2.30.1030.02011.10
5.2.20.1030.02310.88
5.2.10.0000.03010.88
5.2.00.0000.03710.70
5.1.60.0000.0279.91
5.1.50.0070.0209.90
5.1.40.0670.0239.97
5.1.30.1000.03010.40
5.1.20.1100.02710.45
5.1.10.0800.03010.03
5.1.00.0970.02310.24
5.0.50.0700.0308.70
5.0.40.0570.0238.67
5.0.30.0570.0308.13
5.0.20.0530.0238.38
5.0.10.0700.0308.10
5.0.00.0600.0378.12
4.4.90.0670.0277.96
4.4.80.0700.0177.96
4.4.70.0530.0137.96
4.4.60.0700.0107.96
4.4.50.0470.0177.96
4.4.40.0630.0337.96
4.4.30.0530.0177.96
4.4.20.0530.0207.96
4.4.10.0670.0207.96
4.4.00.0570.0307.96
4.3.110.0770.0277.96
4.3.100.0670.0207.96
4.3.90.0570.0177.96
4.3.80.0570.0307.96
4.3.70.0630.0237.96
4.3.60.0600.0107.96
4.3.50.0670.0277.96
4.3.40.0630.0377.96
4.3.30.0270.0177.96
4.3.20.0270.0177.96
4.3.10.0270.0137.96
4.3.00.0270.0177.96

preferences:
51.14 ms | 401 KiB | 5 Q