3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_key_match($target, $match) { $targetKeys = array_keys($target); $diff = array_diff($target, $match); return ($diff == array_diff($diff, $match)); } function array_spit(array $array) { return mb_substr(array_reduce( $array, function ($carry, $item) { return $carry . $item . ', '; }, '[' ), 0, -2) . ']'; } function test($target, $match, $expect) { return sprintf( "Target %s, Match %s: %s", array_spit($target), array_spit($match), (array_key_match($target, $match) == $expect) ? 'true' : 'false' ) . "\n"; } print test([1, 2, 3, 4, 5], [2, 3], true); print test(['a', 'b', 'c'], ['c', 'b'], true); print test([1, 2, 3, 4, 5], [4, 5, 6], false);

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.00618.18
8.3.50.0090.01022.00
8.3.40.0140.00018.66
8.3.30.0110.00318.94
8.3.20.0040.00420.18
8.3.10.0000.00821.77
8.3.00.0070.00419.04
8.2.180.0080.00825.92
8.2.170.0090.00618.97
8.2.160.0100.00320.21
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00019.23
8.2.110.0070.00320.95
8.2.100.0090.00317.72
8.2.90.0030.00517.63
8.2.80.0050.00318.61
8.2.70.0070.00417.50
8.2.60.0040.00417.50
8.2.50.0000.00818.03
8.2.40.0030.00517.63
8.2.30.0000.00718.04
8.2.20.0050.00317.68
8.2.10.0000.00817.96
8.2.00.0000.00817.75
8.1.280.0070.01025.92
8.1.270.0040.00420.45
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0000.00820.96
8.1.230.0040.00820.89
8.1.220.0040.00418.57
8.1.210.0080.00018.77
8.1.200.0060.01017.25
8.1.190.0030.00517.36
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0000.00721.98
8.1.150.0030.00518.96
8.1.140.0040.00417.46
8.1.130.0030.00317.89
8.1.120.0050.00217.52
8.1.110.0040.00417.36
8.1.100.0000.00717.46
8.1.90.0040.00417.38
8.1.80.0040.00417.47
8.1.70.0040.00417.38
8.1.60.0040.00417.55
8.1.50.0090.00017.55
8.1.40.0040.00817.58
8.1.30.0040.00417.66
8.1.20.0000.00817.62
8.1.10.0000.00817.54
8.1.00.0090.00017.48
8.0.300.0050.00518.77
8.0.290.0070.00016.75
8.0.280.0040.00418.52
8.0.270.0000.00717.24
8.0.260.0030.00317.23
8.0.250.0000.00817.05
8.0.240.0040.00416.94
8.0.230.0040.00417.06
8.0.220.0040.00416.82
8.0.210.0050.00216.91
8.0.200.0000.00717.02
8.0.190.0070.00017.04
8.0.180.0000.00717.00
8.0.170.0060.00316.87
8.0.160.0030.00317.06
8.0.150.0030.00316.97
8.0.140.0000.01116.93
8.0.130.0050.00013.47
8.0.120.0000.00716.89
8.0.110.0000.00716.86
8.0.100.0040.00416.96
8.0.90.0030.00316.86
8.0.80.0070.01016.93
8.0.70.0000.00816.89
8.0.60.0040.00416.82
8.0.50.0080.00017.00
8.0.30.0110.01017.04
8.0.20.0140.00817.40
8.0.10.0070.00016.86
8.0.00.0060.01116.75
7.4.330.0000.00515.09
7.4.320.0000.00616.51
7.4.300.0030.00316.56
7.4.290.0030.00316.45
7.4.280.0040.00416.56
7.4.270.0070.00016.56
7.4.260.0030.00616.57
7.4.250.0040.00316.38
7.4.240.0030.00416.54
7.4.230.0000.00716.71
7.4.220.0120.00616.62
7.4.210.0060.00916.55
7.4.200.0000.00716.37
7.4.160.0090.00616.66
7.4.150.0110.02517.40
7.4.140.0060.01217.86
7.4.130.0100.01016.55
7.4.120.0080.01016.60
7.4.110.0110.00716.58
7.4.100.0100.00616.55
7.4.90.0090.00916.51
7.4.80.0060.01019.39
7.4.70.0080.01116.49
7.4.60.0090.01216.47
7.4.50.0000.00816.43
7.4.40.0000.01716.43
7.4.30.0090.00916.48
7.4.10.0100.00715.02
7.4.00.0110.00714.90
7.3.330.0020.00313.38
7.3.320.0100.00313.16
7.3.310.0070.00016.28
7.3.300.0030.00316.31
7.3.290.0080.00716.29
7.3.280.0100.00916.30
7.3.270.0120.01317.40
7.3.260.0040.01816.47
7.3.250.0110.00616.47
7.3.240.0140.00416.72
7.3.230.0060.01616.39
7.3.210.0090.01416.48
7.3.200.0080.00819.39
7.3.190.0060.01016.32
7.3.180.0140.00616.50
7.3.170.0030.01416.37
7.3.160.0000.01616.56
7.3.130.0060.00914.86
7.3.120.0030.01415.05
7.3.110.0120.00615.10
7.3.100.0030.01214.89
7.3.90.0120.00614.90
7.3.80.0110.00414.50
7.3.70.0000.00814.95
7.3.60.0100.00014.84
7.3.50.0030.01214.53
7.3.40.0030.00614.73
7.3.30.0120.00314.84
7.3.20.0030.00716.84
7.3.10.0090.00616.47
7.3.00.0070.00816.31
7.2.330.0060.01216.62
7.2.320.0130.00316.58
7.2.310.0070.01016.73
7.2.300.0030.01316.58
7.2.290.0120.00916.63
7.2.260.0040.01414.76
7.2.250.0030.01015.13
7.2.240.0090.00615.19
7.2.230.0030.01315.16
7.2.220.0060.00915.03
7.2.210.0000.01215.15
7.2.200.0070.00315.10
7.2.190.0030.01315.08
7.2.180.0060.00615.23
7.2.170.0040.00715.21
7.2.160.0050.00515.14
7.2.150.0060.01016.82
7.2.140.0040.00816.99
7.2.130.0070.00716.68
7.2.120.0070.00816.81
7.2.110.0120.00616.66
7.2.100.0070.00616.72
7.2.90.0100.00816.72
7.2.80.0040.01116.66
7.2.70.0060.01016.60
7.2.60.0090.01116.85
7.2.50.0070.00916.71
7.2.40.0110.00816.80
7.2.30.0070.01016.80
7.2.20.0070.01116.70
7.2.10.0060.01216.72
7.2.00.0080.01117.48
7.1.330.0100.00315.66
7.1.320.0080.00415.80
7.1.310.0060.00915.45
7.1.300.0030.01015.95
7.1.290.0070.00715.89
7.1.280.0000.01215.73
7.1.270.0030.01115.78
7.1.260.0000.01415.97
7.1.250.0070.00615.59
7.1.240.0000.01115.51
7.1.230.0030.00615.80
7.1.220.0000.01115.82
7.1.210.0040.00815.55
7.1.200.0070.00715.68
7.1.190.0130.00015.71
7.1.180.0000.01015.52
7.1.170.0080.00515.86
7.1.160.0070.00415.66
7.1.150.0000.00915.55
7.1.140.0090.00615.71
7.1.130.0030.01015.80
7.1.120.0040.01115.89
7.1.110.0030.01015.88
7.1.100.0070.00416.85
7.1.90.0040.01115.68
7.1.80.0070.00715.56
7.1.70.0000.00916.41
7.1.60.0090.01017.70
7.1.50.0040.00716.29
7.1.40.0070.00715.73
7.1.30.0030.00715.60
7.1.20.0030.00915.94
7.1.10.0060.00915.84
7.1.00.0030.04418.98
7.0.330.0060.00615.59
7.0.320.0070.00715.34
7.0.310.0000.01215.40
7.0.300.0000.01115.32
7.0.290.0080.00815.59
7.0.280.0100.00015.41
7.0.270.0050.00315.34
7.0.260.0070.00315.50
7.0.250.0060.00615.51
7.0.240.0060.00915.65
7.0.230.0030.00615.23
7.0.220.0090.00015.17
7.0.210.0060.00915.38
7.0.200.0120.00515.07
7.0.190.0090.00015.53
7.0.180.0030.00915.54
7.0.170.0070.01015.51
7.0.160.0080.00615.37
7.0.150.0060.00915.53
7.0.140.0030.03518.77
7.0.130.0060.00915.29
7.0.120.0030.01015.25
7.0.110.0070.00715.54
7.0.100.0070.00315.34
7.0.90.0120.00615.30
7.0.80.0070.00315.63
7.0.70.0110.00415.54
7.0.60.0050.02617.52
7.0.50.0070.04616.63
7.0.40.0050.03516.84
7.0.30.0260.04316.88
7.0.20.0120.03116.94
7.0.10.0120.04616.67
7.0.00.0110.02816.98
5.6.400.0090.00614.62
5.6.390.0060.00914.49
5.6.380.0080.00414.35
5.6.370.0070.00714.47
5.6.360.0000.01114.60
5.6.350.0070.01114.11
5.6.340.0070.00314.11
5.6.330.0120.00014.20
5.6.320.0090.00614.36
5.6.310.0060.00614.23
5.6.300.0040.00814.52
5.6.290.0090.00314.15
5.6.280.0020.04117.64
5.6.270.0030.00614.50
5.6.260.0040.01114.32
5.6.250.0130.00614.60
5.6.240.0070.01014.22
5.6.230.0070.01014.13
5.6.220.0060.00614.27
5.6.210.0110.02017.44
5.6.200.0050.04216.25
5.6.190.0110.04017.56
5.6.180.0200.03917.28
5.6.170.0240.03017.41
5.6.160.0100.04217.35
5.6.150.0090.04216.34
5.6.140.0030.04516.43
5.6.130.0080.04316.28
5.6.120.0120.04017.50
5.6.110.0070.04317.70
5.6.100.0030.04517.64
5.6.90.0030.02817.56
5.6.80.0050.03917.55
5.6.70.0120.04617.45
5.6.60.0030.01014.34
5.6.50.0080.00014.35
5.6.40.0090.00614.25
5.6.30.0070.00714.39
5.6.20.0060.01014.50
5.6.10.0060.00813.99
5.6.00.0120.00314.09
5.5.380.0090.00914.43
5.5.370.0040.01114.27
5.5.360.0030.01214.43
5.5.350.0150.04017.34
5.5.340.0080.04515.99
5.5.330.0030.03717.26
5.5.320.0080.04817.14
5.5.310.0080.04617.37
5.5.300.0030.04716.29
5.5.290.0070.04516.27
5.5.280.0050.02717.61
5.5.270.0120.04217.65
5.5.260.0050.02617.54
5.5.250.0130.04017.49
5.5.240.0050.04317.14
5.5.230.0100.00314.25
5.5.220.0040.01114.37
5.5.210.0060.00614.18
5.5.200.0000.01714.30
5.5.190.0060.00613.93
5.5.180.0060.00914.16
5.5.170.0090.00314.40
5.5.160.0030.01314.31
5.5.150.0110.00414.19
5.5.140.0040.00814.23
5.5.130.0110.00314.09
5.5.120.0000.01314.30
5.5.110.0000.01414.27
5.5.100.0080.00814.45
5.5.90.0110.00414.43
5.5.80.0040.01114.43
5.5.70.0070.00714.45
5.5.60.0070.00714.37
5.5.50.0070.00314.07
5.5.40.0070.00714.25
5.5.30.0000.01814.34
5.5.20.0070.00714.26
5.5.10.0000.00914.29
5.5.00.0040.01113.96
5.4.450.0060.03415.70
5.4.440.0630.04215.81
5.4.430.0300.03415.79
5.4.420.0530.03015.64
5.4.410.0500.02815.58
5.4.400.0170.03515.40
5.4.390.0190.03515.41
5.4.380.0180.03715.25
5.4.370.0260.03815.41
5.4.360.0250.03815.28
5.4.350.0230.03015.33
5.4.340.0180.04315.32
5.4.330.0040.00412.04
5.4.320.0230.03515.37
5.4.310.0190.02915.41
5.4.300.0120.03715.25
5.4.290.0150.03815.26
5.4.280.0260.03515.25
5.4.270.0250.04115.41
5.4.260.0260.03015.30
5.4.250.0180.03115.38
5.4.240.0220.02515.46
5.4.230.0320.02815.31
5.4.220.0260.02915.38
5.4.210.0270.03215.32
5.4.200.0280.03414.29
5.4.190.0260.03715.41
5.4.180.0300.03015.36
5.4.170.0250.03315.27
5.4.160.0250.03815.39
5.4.150.0200.04115.29
5.4.140.0200.03114.17
5.4.130.0280.02314.17
5.4.120.0230.02914.14
5.4.110.0260.02314.13
5.4.100.0170.03414.20
5.4.90.0210.03614.13
5.4.80.0270.03714.11
5.4.70.0370.03014.23
5.4.60.0250.03814.22
5.4.50.0190.02814.22
5.4.40.0330.02014.23
5.4.30.0200.03114.14
5.4.20.0150.04214.09
5.4.10.0180.03614.14
5.4.00.0210.02813.84
5.3.290.0500.05314.70
5.3.280.0370.06314.63
5.3.270.0430.05014.65
5.3.260.0400.05714.74
5.3.250.0530.05314.74
5.3.240.0470.05314.76
5.3.230.0600.06014.73
5.3.220.0430.06014.61
5.3.210.0400.05714.71
5.3.200.0570.05714.58
5.3.190.0500.06714.80
5.3.180.0570.06014.70
5.3.170.0470.06014.77
5.3.160.0600.06714.63
5.3.150.0530.06314.63
5.3.140.0300.06314.61
5.3.130.0470.07714.61
5.3.120.0430.08014.68
5.3.110.0400.08314.62
5.3.100.0630.06714.09
5.3.90.0430.07314.11
5.3.80.0530.04714.15
5.3.70.0430.05714.05
5.3.60.0630.05714.12
5.3.50.0370.07314.02
5.3.40.0470.07313.96
5.3.30.0730.05713.96
5.3.20.0270.07713.91
5.3.10.0470.07013.89
5.3.00.0530.05013.74
5.2.170.0400.04311.36
5.2.160.0300.04711.20
5.2.150.0400.05711.19
5.2.140.0330.04311.13
5.2.130.0270.05011.23
5.2.120.0300.05711.23
5.2.110.0370.05311.12
5.2.100.0400.04711.13
5.2.90.0300.05711.21
5.2.80.0200.05011.11
5.2.70.0330.03711.11
5.2.60.0270.04311.11
5.2.50.0130.06011.02
5.2.40.0170.04311.03
5.2.30.0200.04011.10
5.2.20.0130.05711.13
5.2.10.0200.04311.08
5.2.00.0100.04710.76
5.1.60.0200.04010.16
5.1.50.0130.03710.00
5.1.40.0230.02310.01
5.1.30.0170.04310.37
5.1.20.0100.04310.38
5.1.10.0200.03310.19
5.1.00.0130.04710.20
5.0.50.0170.0338.62
5.0.40.0100.0278.54
5.0.30.0100.0438.42
5.0.20.0200.0208.26
5.0.10.0170.0278.21
5.0.00.0070.0508.38
4.4.90.0100.0205.91
4.4.80.0130.0175.91
4.4.70.0070.0235.91
4.4.60.0070.0235.89
4.4.50.0130.0205.91
4.4.40.0170.0405.98
4.4.30.0070.0275.91
4.4.20.0070.0276.04
4.4.10.0130.0176.07
4.4.00.0100.0335.94
4.3.110.0100.0235.82
4.3.100.0070.0235.86
4.3.90.0070.0235.79
4.3.80.0130.0375.92
4.3.70.0030.0275.78
4.3.60.0100.0235.88
4.3.50.0100.0305.80
4.3.40.0130.0405.76
4.3.30.0130.0234.55
4.3.20.0030.0274.54
4.3.10.0100.0234.51
4.3.00.0000.0236.90

preferences:
58.65 ms | 401 KiB | 5 Q