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", print_r($target, true), print_r($match, true), (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.0120.00316.63
8.3.50.0110.00318.25
8.3.40.0070.01118.79
8.3.30.0080.00818.75
8.3.20.0070.00020.20
8.3.10.0040.00421.91
8.3.00.0050.00319.38
8.2.180.0190.00918.54
8.2.170.0070.01419.08
8.2.160.0110.00722.96
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0080.00019.48
8.2.110.0080.00319.45
8.2.100.0040.00817.75
8.2.90.0000.00719.17
8.2.80.0090.00017.97
8.2.70.0080.00017.60
8.2.60.0000.00818.03
8.2.50.0000.00918.07
8.2.40.0050.00319.88
8.2.30.0000.00718.11
8.2.20.0030.00617.82
8.2.10.0000.00818.09
8.2.00.0040.00417.79
8.1.280.0090.00925.92
8.1.270.0060.00320.53
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0040.00423.98
8.1.230.0120.00017.55
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.47
8.1.190.0030.00517.38
8.1.180.0000.00918.10
8.1.170.0030.00618.88
8.1.160.0040.00422.14
8.1.150.0000.00718.98
8.1.140.0030.00517.50
8.1.130.0030.00317.83
8.1.120.0030.00617.51
8.1.110.0080.00017.68
8.1.100.0040.00417.62
8.1.90.0070.00017.66
8.1.80.0000.00717.69
8.1.70.0030.00317.52
8.1.60.0030.00617.68
8.1.50.0030.00617.59
8.1.40.0070.00317.76
8.1.30.0040.00417.72
8.1.20.0080.00017.70
8.1.10.0040.00417.65
8.1.00.0050.00517.65
8.0.300.0040.00418.77
8.0.290.0040.00417.13
8.0.280.0070.00018.50
8.0.270.0080.00016.89
8.0.260.0000.00717.26
8.0.250.0040.00417.14
8.0.240.0050.00317.00
8.0.230.0000.00717.13
8.0.220.0070.00017.07
8.0.210.0070.00016.95
8.0.200.0030.00317.09
8.0.190.0030.00517.09
8.0.180.0030.00517.13
8.0.170.0000.00817.17
8.0.160.0050.00217.16
8.0.150.0000.00717.02
8.0.140.0070.00317.01
8.0.130.0030.00313.53
8.0.120.0000.00816.95
8.0.110.0040.00416.90
8.0.100.0040.00416.96
8.0.90.0040.00417.18
8.0.80.0000.02117.04
8.0.70.0030.00516.98
8.0.60.0060.00317.13
8.0.50.0070.00017.05
8.0.30.0130.01017.44
8.0.20.0040.01817.40
8.0.10.0070.00017.14
8.0.00.0080.01117.04
7.4.330.0000.00515.03
7.4.320.0050.00316.69
7.4.300.0070.00016.79
7.4.290.0030.00316.63
7.4.280.0000.00816.82
7.4.270.0000.00716.66
7.4.260.0030.00516.82
7.4.250.0000.00716.71
7.4.240.0040.00416.79
7.4.230.0030.00316.95
7.4.220.0150.00316.83
7.4.210.0100.00716.94
7.4.200.0030.00516.74
7.4.160.0110.00416.70
7.4.150.0120.01317.40
7.4.140.0080.01117.86
7.4.130.0090.01016.80
7.4.120.0100.00816.71
7.4.110.0120.00616.84
7.4.100.0060.01616.81
7.4.90.0100.00716.68
7.4.80.0160.00619.39
7.4.70.0090.00616.76
7.4.60.0070.01316.78
7.4.50.0000.00816.53
7.4.40.0060.01016.64
7.4.30.0080.00816.82
7.4.00.0070.01015.21
7.3.330.0000.00513.32
7.3.320.0060.00613.30
7.3.310.0050.00216.45
7.3.300.0030.00316.32
7.3.290.0070.00816.49
7.3.280.0090.00916.42
7.3.270.0180.01117.40
7.3.260.0060.01116.49
7.3.250.0130.00516.64
7.3.240.0160.00616.76
7.3.230.0130.01016.50
7.3.210.0130.01016.49
7.3.200.0030.01419.39
7.3.190.0130.00316.69
7.3.180.0000.01916.53
7.3.170.0110.00616.61
7.3.160.0070.01016.62
7.2.330.0040.01916.83
7.2.320.0110.00516.84
7.2.310.0090.00916.73
7.2.300.0100.00616.70
7.2.290.0080.01216.56
7.2.00.0060.00919.78
7.1.100.0000.00818.16
7.1.70.0000.01617.40
7.1.60.0060.01919.50
7.1.50.0070.01516.80
7.1.00.0030.07722.36
7.0.200.1170.00715.20
7.0.140.0000.05322.01
7.0.60.0070.04720.03
7.0.50.0070.05717.87
7.0.40.0130.08320.14
7.0.30.0370.07020.11
7.0.20.0270.07320.32
7.0.10.0470.06720.18
7.0.00.0030.08720.25
5.6.280.0100.06321.12
5.6.210.0130.08020.50
5.6.200.0130.07718.14
5.6.190.0070.08720.49
5.6.180.0200.06320.42
5.6.170.0270.07020.44
5.6.160.0030.05320.47
5.6.150.0030.08318.18
5.6.140.0070.03718.28
5.6.130.0130.07718.14
5.6.120.0100.08021.12
5.6.110.0230.07321.00
5.6.100.0070.08321.03
5.6.90.0030.05721.14
5.6.80.0200.06720.38
5.6.70.0200.06720.38
5.5.350.0300.07720.35
5.5.340.0070.08317.94
5.5.330.0130.07720.43
5.5.320.0030.08320.35
5.5.310.0300.05320.20
5.5.300.0100.07717.97
5.5.290.0030.08718.03
5.5.280.0030.04720.77
5.5.270.0030.06720.96
5.5.260.0000.04320.84
5.5.250.0030.08020.71
5.5.240.0070.05020.36
5.4.450.0700.05319.47
5.4.440.0800.05319.57
5.4.430.0170.06719.57
5.4.420.0870.06019.57
5.4.410.0030.06019.18
5.4.400.0470.05718.61
5.4.390.0330.05718.71
5.4.380.0400.07018.73
5.4.370.0430.06318.82
5.4.360.0370.05718.59
5.4.350.0430.07018.71
5.4.340.0230.07718.61
5.4.320.0330.06718.68
5.4.310.0270.05318.75
5.4.300.0200.06018.59
5.4.290.0270.04718.46
5.4.280.0270.07318.56
5.4.270.0330.07018.77
5.4.260.0370.07018.73
5.4.250.0300.07718.74
5.4.240.0330.05318.46
5.4.230.0170.05318.59
5.4.220.0130.07018.45
5.4.210.0300.07718.39
5.4.200.0400.07316.62
5.4.190.0330.07018.69
5.4.180.0330.07018.60
5.4.170.0400.06018.68
5.4.160.0470.04018.50
5.4.150.0470.06318.57
5.4.140.0230.06016.30
5.4.130.0370.05716.17
5.4.120.0170.07716.20
5.4.110.0230.05016.20
5.4.100.0230.07016.23
5.4.90.0500.04316.22
5.4.80.0330.06316.21
5.4.70.0200.06716.40
5.4.60.0170.06316.35
5.4.50.0400.06016.29
5.4.40.0270.07016.21
5.4.30.0430.05316.19
5.4.20.0430.04016.16
5.4.10.0300.05016.29
5.4.00.0230.06015.88
5.3.290.0330.06714.66
5.3.280.0270.07014.62
5.3.270.0330.07014.76
5.3.260.0300.06014.62
5.3.250.0300.08014.64
5.3.240.0330.07714.63
5.3.230.0270.06714.64
5.3.220.0270.05314.61
5.3.210.0400.06714.63
5.3.200.0400.05314.78
5.3.190.0630.07014.58
5.3.180.0330.08014.61
5.3.170.0500.05714.59
5.3.160.0470.06714.68
5.3.150.0430.07314.74
5.3.140.0370.08014.57
5.3.130.0500.06314.77
5.3.120.0300.07014.77
5.3.110.0500.06714.59
5.3.100.0470.07014.21
5.3.90.0470.05714.20
5.3.80.0430.07314.12
5.3.70.0330.06314.08
5.3.60.0400.06314.01
5.3.50.0300.06314.16
5.3.40.0570.05714.05
5.3.30.0430.06714.02
5.3.20.0470.05013.80
5.3.10.0400.05713.81
5.3.00.0370.05713.68
5.2.170.0330.04311.25
5.2.160.0270.05011.34
5.2.150.0330.04011.14
5.2.140.0330.05311.34
5.2.130.0200.04711.18
5.2.120.0300.04011.13
5.2.110.0370.04711.20
5.2.100.0470.03711.16
5.2.90.0400.04011.13
5.2.80.0300.05711.23
5.2.70.0500.05011.20
5.2.60.0230.06311.16
5.2.50.0370.05311.22
5.2.40.0330.05011.05
5.2.30.0270.03711.08
5.2.20.0330.04311.17
5.2.10.0270.05310.91
5.2.00.0200.04310.85
5.1.60.0200.03710.12
5.1.50.0330.04310.11
5.1.40.0300.02710.05
5.1.30.0430.04010.33
5.1.20.0300.04310.47
5.1.10.0400.03310.11
5.1.00.0200.04310.24
5.0.50.0370.0238.72
5.0.40.0270.0278.44
5.0.30.0230.0408.34
5.0.20.0230.0378.24
5.0.10.0200.0378.25
5.0.00.0100.0538.34
4.4.90.0100.0235.91
4.4.80.0070.0275.91
4.4.70.0070.0375.90
4.4.60.0170.0275.94
4.4.50.0130.0205.98
4.4.40.0100.0375.91
4.4.30.0130.0236.00
4.4.20.0130.0205.96
4.4.10.0130.0275.94
4.4.00.0130.0435.95
4.3.110.0200.0235.86
4.3.100.0130.0275.80
4.3.90.0170.0175.84
4.3.80.0070.0375.88
4.3.70.0130.0175.79
4.3.60.0130.0235.84
4.3.50.0100.0235.84
4.3.40.0100.0335.78
4.3.30.0030.0234.57
4.3.20.0030.0274.67
4.3.10.0230.0174.55
4.3.00.0100.0236.90

preferences:
55.53 ms | 400 KiB | 5 Q