3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * make sure the setA and setB are the same */ function isSame($setA, $setB) { var_dump($setA); var_dump($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) { 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.0090.00916.75
8.3.50.0070.01022.76
8.3.40.0070.00719.11
8.3.30.0100.00719.04
8.3.20.0050.00320.16
8.3.10.0030.00623.53
8.3.00.0030.00519.38
8.2.180.0040.01116.88
8.2.170.0140.00322.96
8.2.160.0170.00020.38
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0050.00326.16
8.2.120.0070.00021.15
8.2.110.0060.00322.07
8.2.100.0060.00617.84
8.2.90.0000.00819.34
8.2.80.0000.00817.97
8.2.70.0000.00817.75
8.2.60.0090.00018.04
8.2.50.0080.00018.07
8.2.40.0000.00819.78
8.2.30.0030.00618.20
8.2.20.0040.00417.80
8.2.10.0050.00318.03
8.2.00.0030.00617.75
8.1.280.0170.00325.92
8.1.270.0060.00323.83
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.91
8.1.230.0030.00919.21
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0040.00417.25
8.1.190.0080.00017.25
8.1.180.0050.00318.10
8.1.170.0000.00818.66
8.1.160.0040.00421.93
8.1.150.0000.00718.93
8.1.140.0000.00717.39
8.1.130.0030.00317.82
8.1.120.0000.00717.45
8.1.110.0040.00417.43
8.1.100.0040.00417.36
8.1.90.0040.00417.46
8.1.80.0040.00417.53
8.1.70.0030.00517.38
8.1.60.0030.00517.50
8.1.50.0040.00417.41
8.1.40.0040.00417.49
8.1.30.0050.00317.58
8.1.20.0000.00817.69
8.1.10.0040.00417.52
8.1.00.0030.00517.47
8.0.300.0040.00418.77
8.0.290.0070.00016.63
8.0.280.0000.00718.40
8.0.270.0000.00717.22
8.0.260.0000.00817.19
8.0.250.0070.00016.99
8.0.240.0040.00417.01
8.0.230.0070.00016.99
8.0.220.0000.00616.88
8.0.210.0050.00316.87
8.0.200.0060.00317.02
8.0.190.0000.00916.91
8.0.180.0030.00617.01
8.0.170.0030.00617.03
8.0.160.0050.00316.96
8.0.150.0000.00816.99
8.0.140.0030.00516.90
8.0.130.0030.00313.34
8.0.120.0000.00816.94
8.0.110.0000.00716.98
8.0.100.0000.00816.92
8.0.90.0080.00016.86
8.0.80.0130.00316.94
8.0.70.0040.00416.84
8.0.60.0040.00416.82
8.0.50.0080.00017.00
8.0.30.0140.00817.23
8.0.20.0060.01217.40
8.0.10.0050.00216.95
8.0.00.0050.01216.67
7.4.330.0000.00515.16
7.4.320.0060.00016.63
7.4.300.0000.00616.63
7.4.290.0000.00716.68
7.4.280.0090.00316.45
7.4.270.0030.00316.46
7.4.260.0040.00416.53
7.4.250.0000.00816.63
7.4.240.0060.00116.58
7.4.230.0000.00716.65
7.4.220.0060.01116.58
7.4.210.0000.01416.57
7.4.200.0000.00816.48
7.4.160.0030.01316.41
7.4.150.0180.00517.40
7.4.140.0120.00417.86
7.4.130.0070.01016.59
7.4.120.0110.00916.44
7.4.110.0100.00916.52
7.4.100.0100.00716.70
7.4.90.0080.00816.55
7.4.80.0170.00019.39
7.4.70.0150.00816.66
7.4.60.0100.00716.43
7.4.50.0050.00016.45
7.4.40.0060.01116.46
7.4.30.0170.00016.41
7.4.00.0110.00414.78
7.3.330.0000.00613.44
7.3.320.0000.00613.36
7.3.310.0000.00716.41
7.3.300.0000.00816.32
7.3.290.0090.00616.37
7.3.280.0060.01016.45
7.3.270.0110.00817.40
7.3.260.0090.00916.44
7.3.250.0110.00816.48
7.3.240.0090.01216.42
7.3.230.0160.00016.44
7.3.210.0040.01416.38
7.3.200.0160.00619.39
7.3.190.0060.01016.54
7.3.180.0060.01216.60
7.3.170.0100.00716.44
7.3.160.0110.00516.61
7.2.330.0090.00916.79
7.2.320.0090.01316.65
7.2.310.0030.01516.79
7.2.300.0130.00716.69
7.2.290.0170.00016.90
7.2.80.0030.01016.84
7.2.60.0040.01116.76
7.2.00.0280.00819.27
7.1.200.0040.00815.87
7.1.100.0060.00318.23
7.1.70.0000.00917.26
7.1.60.0070.01419.40
7.1.50.0090.00916.85
7.1.00.0070.07322.27
7.0.200.0090.00016.96
7.0.140.0000.07722.01
7.0.60.0070.08019.89
7.0.50.0100.03717.87
7.0.40.0100.04020.24
7.0.30.0470.07020.12
7.0.20.0330.08020.23
7.0.10.0100.08320.33
7.0.00.0000.04320.23
5.6.280.0030.07321.08
5.6.210.0100.03320.58
5.6.200.0100.08318.20
5.6.190.0100.07720.40
5.6.180.0230.03720.61
5.6.170.0130.05720.46
5.6.160.0070.07320.50
5.6.150.0070.04318.15
5.6.140.0100.08018.15
5.6.130.0230.06318.24
5.6.120.0130.03321.02
5.6.110.0130.07721.02
5.6.100.0070.06721.09
5.6.90.0130.08721.11
5.6.80.0070.06020.37
5.5.350.0100.07720.50
5.5.340.0100.05318.04
5.5.330.0100.04020.56
5.5.320.0070.08720.32
5.5.310.0370.05020.27
5.5.300.0100.07718.01
5.5.290.0270.03717.98
5.5.280.0070.05720.78
5.5.270.0000.05320.77
5.5.260.0100.04020.95
5.5.250.0100.07720.62
5.5.240.3500.02720.19
5.4.450.0430.04719.42
5.4.440.0270.05019.48
5.4.430.0270.05019.47
5.4.420.0200.05319.16
5.4.410.0230.04719.29
5.4.400.0100.04319.00
5.4.390.0130.04319.20
5.4.380.0230.05718.63
5.4.370.0270.07018.68
5.4.360.0330.04718.73
5.4.350.0170.06018.48
5.4.340.0300.04318.75
5.4.320.0080.03412.52
5.4.310.0050.04012.51
5.4.300.0070.03612.52
5.4.290.0070.04012.51
5.4.280.0050.03912.41
5.4.270.0030.04012.41
5.4.260.0040.03912.41
5.4.250.0070.03712.41
5.4.240.0070.03612.40
5.4.230.0030.04112.40
5.4.220.0060.03812.40
5.4.210.0100.04512.40
5.4.200.0060.04412.40
5.4.190.0080.03312.39
5.4.180.0100.03812.39
5.4.170.0110.03312.40
5.4.160.0060.04512.39
5.4.150.0060.04512.39
5.4.140.0050.05012.08
5.4.130.0060.03612.07
5.4.120.0070.04112.02
5.4.110.0060.03712.02
5.4.100.0060.03712.02
5.4.90.0060.03712.02
5.4.80.0070.04212.02
5.4.70.0050.03512.02
5.4.60.0070.03312.02
5.4.50.0050.03612.02
5.4.40.0060.03412.00
5.4.30.0040.03712.00
5.4.20.0070.03412.00
5.4.10.0080.03212.00
5.4.00.0070.03411.49
5.3.290.0060.03912.80
5.3.280.0060.04112.70
5.3.270.0070.03712.72
5.3.260.0050.03912.72
5.3.250.0040.03812.72
5.3.240.0070.03612.71
5.3.230.0060.03712.71
5.3.220.0070.03412.68
5.3.210.0040.04012.68
5.3.200.0080.03312.68
5.3.190.0070.03512.68
5.3.180.0060.03612.67
5.3.170.0080.03412.67
5.3.160.0080.03412.67
5.3.150.0070.03512.68
5.3.140.0020.03912.66
5.3.130.0070.03712.66
5.3.120.0080.03612.65
5.3.110.0060.03812.66
5.3.100.0060.04412.14
5.3.90.0060.03612.12
5.3.80.0050.03712.11
5.3.70.0110.03812.11
5.3.60.0060.05012.10
5.3.50.0070.03512.04
5.3.40.0040.03812.04
5.3.30.0030.03912.00
5.3.20.0060.03511.79
5.3.10.0030.03711.75
5.3.00.0070.03511.73
5.2.170.0040.0319.23
5.2.160.0050.0289.23
5.2.150.0060.0299.24
5.2.140.0020.0379.23
5.2.130.0060.0299.20
5.2.120.0080.0429.20
5.2.110.0040.0349.20
5.2.100.0030.0309.19
5.2.90.0050.0289.19
5.2.80.0030.0329.19
5.2.70.0070.0289.19
5.2.60.0050.0299.15
5.2.50.0050.0309.11
5.2.40.0080.0269.09
5.2.30.0030.0329.06
5.2.20.0090.0369.06
5.2.10.0080.0368.96
5.2.00.0080.0268.82
5.1.60.0010.0288.11
5.1.50.0020.0278.10
5.1.40.0030.0268.08
5.1.30.0050.0258.43
5.1.20.0040.0278.45
5.1.10.0050.0258.18
5.1.00.0040.0268.18
5.0.50.0020.0236.68
5.0.40.0040.0196.54
5.0.30.0010.0346.35
5.0.20.0040.0196.30
5.0.10.0060.0186.29
5.0.00.0060.0286.29
4.4.90.0030.0154.78
4.4.80.0020.0164.76
4.4.70.0030.0154.75
4.4.60.0030.0154.76
4.4.50.0050.0144.77
4.4.40.0030.0264.71
4.4.30.0040.0144.76
4.4.20.0020.0164.84
4.4.10.0010.0174.85
4.4.00.0020.0254.76
4.3.110.0020.0164.67
4.3.100.0040.0144.67
4.3.90.0020.0154.63
4.3.80.0040.0234.58
4.3.70.0010.0164.63
4.3.60.0030.0144.63
4.3.50.0020.0164.63
4.3.40.0020.0244.54
4.3.30.0030.0153.33
4.3.20.0020.0163.31
4.3.10.0020.0153.27
4.3.00.0100.01015.62

preferences:
43.35 ms | 401 KiB | 5 Q