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 test($target, $match, $expect) { return preg_replace('/\n/', '', sprintf( "Target %s, Match %s: %s\n", var_dump($target, true), var_dump($match, true), (array_key_match($target, $match) == $expect) ? 'true' : 'false' )); } 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.0040.01116.75
8.3.50.0040.01522.13
8.3.40.0090.00918.89
8.3.30.0120.00819.09
8.3.20.0070.00020.34
8.3.10.0050.00321.75
8.3.00.0000.00819.38
8.2.180.0090.00616.75
8.2.170.0110.00722.96
8.2.160.0070.00720.45
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00819.48
8.2.110.0050.00522.37
8.2.100.0080.00417.84
8.2.90.0050.00319.04
8.2.80.0040.00417.97
8.2.70.0090.00017.88
8.2.60.0040.00418.04
8.2.50.0030.00518.07
8.2.40.0000.00818.16
8.2.30.0040.00418.10
8.2.20.0040.00417.82
8.2.10.0040.00417.97
8.2.00.0030.00617.93
8.1.280.0030.01325.92
8.1.270.0060.00320.65
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0090.00022.01
8.1.230.0070.00722.71
8.1.220.0050.00317.79
8.1.210.0040.00418.85
8.1.200.0000.00917.48
8.1.190.0030.00517.48
8.1.180.0000.00818.10
8.1.170.0040.00419.04
8.1.160.0040.00422.03
8.1.150.0040.00418.93
8.1.140.0000.00817.53
8.1.130.0030.00317.86
8.1.120.0000.00817.62
8.1.110.0080.00017.47
8.1.100.0000.00717.60
8.1.90.0000.00717.51
8.1.80.0080.00017.61
8.1.70.0000.00817.63
8.1.60.0000.00917.79
8.1.50.0000.00817.63
8.1.40.0050.00517.58
8.1.30.0000.00817.73
8.1.20.0070.00017.81
8.1.10.0000.00917.56
8.1.00.0080.00317.49
8.0.300.0040.00419.95
8.0.290.0000.00816.88
8.0.280.0070.00018.44
8.0.270.0030.00317.30
8.0.260.0030.00317.20
8.0.250.0040.00416.99
8.0.240.0030.00317.00
8.0.230.0000.00717.06
8.0.220.0050.00217.04
8.0.210.0030.00316.92
8.0.200.0000.00617.12
8.0.190.0000.00817.00
8.0.180.0020.00517.11
8.0.170.0050.00317.10
8.0.160.0070.00016.93
8.0.150.0080.00016.95
8.0.140.0060.00716.86
8.0.130.0030.00313.44
8.0.120.0040.00416.96
8.0.110.0040.00417.07
8.0.100.0000.00717.09
8.0.90.0040.00417.01
8.0.80.0100.00717.07
8.0.70.0000.00817.05
8.0.60.0080.00016.88
8.0.50.0000.00817.05
8.0.30.0100.01217.22
8.0.20.0070.01317.44
8.0.10.0070.00017.18
8.0.00.0080.00917.22
7.4.330.0000.00515.07
7.4.320.0000.00616.77
7.4.300.0000.00716.80
7.4.290.0080.00016.74
7.4.280.0040.00416.80
7.4.270.0030.00316.72
7.4.260.0040.00416.74
7.4.250.0050.00316.70
7.4.240.0040.00416.81
7.4.230.0000.00716.63
7.4.220.0130.00516.77
7.4.210.0130.01016.61
7.4.200.0000.00716.66
7.4.160.0000.01716.68
7.4.150.0180.00717.40
7.4.140.0030.01717.86
7.4.130.0070.01316.71
7.4.120.0130.00516.62
7.4.110.0070.01116.45
7.4.100.0090.00916.62
7.4.90.0130.00416.66
7.4.80.0090.00919.39
7.4.70.0110.00716.81
7.4.60.0070.01016.72
7.4.50.0000.00816.61
7.4.40.0070.01016.77
7.4.30.0150.00616.52
7.4.00.0030.01315.20
7.3.330.0000.00613.45
7.3.320.0090.00513.44
7.3.310.0070.00016.36
7.3.300.0030.00316.34
7.3.290.0070.00816.46
7.3.280.0060.01216.42
7.3.270.0070.01817.40
7.3.260.0140.00816.86
7.3.250.0130.00716.52
7.3.240.0120.01216.39
7.3.230.0140.00316.61
7.3.210.0080.01116.52
7.3.200.0130.00919.39
7.3.190.0090.01216.43
7.3.180.0130.01016.56
7.3.170.0090.01216.79
7.3.160.0130.00416.77
7.2.330.0120.00616.79
7.2.320.0140.00316.82
7.2.310.0110.00716.61
7.2.300.0120.01216.79
7.2.290.0070.01016.66
7.2.110.0180.00916.82
7.2.60.0070.01016.86
7.2.00.0090.00019.65
7.1.200.0100.00315.94
7.1.100.0030.00817.92
7.1.70.0030.00517.02
7.1.60.0070.01719.50
7.1.50.0000.01117.11
7.1.00.0030.07722.34
7.0.200.1400.00714.85
7.0.140.0030.05321.96
7.0.60.0100.03321.83
7.0.50.0030.04017.90
7.0.40.0100.04320.08
7.0.30.0200.06020.26
7.0.20.0330.05020.16
7.0.10.0070.09020.16
7.0.00.0130.08020.25
5.6.280.0130.06320.87
5.6.210.0030.04020.77
5.6.200.0130.08018.18
5.6.190.0000.04720.64
5.6.180.0370.07320.61
5.6.170.0170.05320.61
5.6.160.0030.05320.54
5.6.150.0170.07718.19
5.6.140.0000.04318.14
5.6.130.0030.07718.18
5.6.120.0070.07721.02
5.6.110.0100.06720.99
5.6.100.0100.06720.98
5.6.90.0030.04021.00
5.6.80.0030.08320.52
5.5.350.3600.04720.34
5.5.340.0000.04017.99
5.5.330.0070.04020.57
5.5.320.0200.04020.36
5.5.310.0270.08720.30
5.5.300.0000.04718.01
5.5.290.0000.09017.99
5.5.280.0030.08320.79
5.5.270.0070.09020.86
5.5.260.0130.03020.76
5.5.250.0130.07720.61
5.5.240.0170.02720.04
5.4.450.0570.06019.59
5.4.440.0800.05719.48
5.4.430.0830.05719.31
5.4.420.0470.07719.36
5.4.410.0770.05019.00
5.4.400.0330.05318.84
5.4.390.0370.06018.75
5.4.380.0300.06018.83
5.4.370.0230.06318.73
5.4.360.0300.08018.56
5.4.350.0370.08018.52
5.4.340.0570.06318.46
5.4.320.0370.08018.74
5.4.310.0330.08018.79
5.4.300.0330.06318.74
5.4.290.0430.07018.60
5.4.280.0230.06318.58
5.4.270.0300.06018.55
5.4.260.0330.05718.45
5.4.250.0400.07318.74
5.4.240.0270.06718.82
5.4.230.0270.06318.44
5.4.220.0400.05318.54
5.4.210.0470.05718.77
5.4.200.0430.05316.79
5.4.190.0400.05318.59
5.4.180.0300.05718.71
5.4.170.0370.08018.44
5.4.160.0430.06318.57
5.4.150.0500.05018.72
5.4.140.0300.05716.28
5.4.130.0270.05316.36
5.4.120.0430.05716.22
5.4.110.0370.07316.28
5.4.100.0470.06316.28
5.4.90.0270.08316.32
5.4.80.0300.07716.30
5.4.70.0470.04716.19
5.4.60.0330.05716.37
5.4.50.0370.05016.23
5.4.40.0330.06716.41
5.4.30.0300.05316.18
5.4.20.0370.05316.29
5.4.10.0400.05716.24
5.4.00.0400.04315.70
5.3.290.0300.06714.88
5.3.280.0400.04314.58
5.3.270.0270.06314.73
5.3.260.0430.05014.77
5.3.250.0270.07314.63
5.3.240.0230.09014.61
5.3.230.0370.04714.62
5.3.220.0270.05314.78
5.3.210.0230.06014.66
5.3.200.0430.03714.78
5.3.190.0270.06314.61
5.3.180.0400.06014.62
5.3.170.0430.05014.59
5.3.160.0200.07014.57
5.3.150.0270.06314.67
5.3.140.0330.05714.68
5.3.130.0270.06314.61
5.3.120.0370.06014.64
5.3.110.0370.05014.69
5.3.100.0270.05714.17
5.3.90.0370.06714.05
5.3.80.0270.05714.07
5.3.70.0330.05014.04
5.3.60.0300.06314.04
5.3.50.0370.05014.01
5.3.40.0430.05313.97
5.3.30.0270.06713.97
5.3.20.0270.06013.69
5.3.10.0170.05713.72
5.3.00.0330.07313.70
5.2.170.0230.04711.21
5.2.160.0300.05311.36
5.2.150.0370.04011.16
5.2.140.0230.04311.25
5.2.130.0330.04011.32
5.2.120.0230.04011.14
5.2.110.0230.04011.22
5.2.100.0230.05011.16
5.2.90.0200.04711.13
5.2.80.0300.04311.23
5.2.70.0270.05711.21
5.2.60.0170.06311.18
5.2.50.0300.05011.15
5.2.40.0200.04711.04
5.2.30.0300.03711.01
5.2.20.0200.04311.17
5.2.10.0130.05310.90
5.2.00.0270.05010.81
5.1.60.0230.03310.12
5.1.50.0100.04010.04
5.1.40.0200.03010.10
5.1.30.0170.04010.40
5.1.20.0200.03710.39
5.1.10.0200.04310.27
5.1.00.0170.03710.24
5.0.50.0170.0308.75
5.0.40.0130.0278.61
5.0.30.0130.0438.32
5.0.20.0070.0338.29
5.0.10.0200.0308.21
5.0.00.0100.0508.32
4.4.90.0030.0276.05
4.4.80.0030.0275.90
4.4.70.0070.0305.97
4.4.60.0170.0205.96
4.4.50.0070.0305.91
4.4.40.0070.0375.88
4.4.30.0070.0305.89
4.4.20.0070.0275.98
4.4.10.0070.0275.95
4.4.00.0030.0405.94
4.3.110.0130.0205.87
4.3.100.0070.0235.89
4.3.90.0130.0235.93
4.3.80.0070.0375.80
4.3.70.0200.0275.88
4.3.60.0130.0205.85
4.3.50.0070.0305.83
4.3.40.0030.0375.75
4.3.30.0070.0204.57
4.3.20.0070.0204.53
4.3.10.0030.0304.62
4.3.00.0070.0237.41

preferences:
46.06 ms | 401 KiB | 5 Q