3v4l.org

run code in 300+ PHP versions simultaneously
<?php $A = [3,45,67,8]; $B = [ 1 => [1,6,8], 2 => [5,67,3,4,5,66,6], 3 => [55,56,57,58], 4 => [45,80,81,82] ]; $result = []; foreach ($A as $needle) { if ($found = array_keys($B, $needle)) { // something qualified echo "Found: "; var_export($found); $result = array_merge($result, $found); // store the new key(s) $B = array_intersect_key($B, $found); // reduce the haystack } echo "Needle: $needle\n"; var_export($B); echo "\n--\n"; var_export($result); echo "\n----\n"; }

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.00618.56
8.3.50.0140.00418.08
8.3.40.0100.00618.67
8.3.30.0130.00318.79
8.3.20.0040.00419.29
8.3.10.0000.00723.70
8.3.00.0080.00020.71
8.2.180.0040.01118.18
8.2.170.0120.00622.96
8.2.160.0100.00321.98
8.2.150.0080.00024.18
8.2.140.0120.00324.66
8.2.130.0030.00519.64
8.2.120.0080.00026.35
8.2.110.0060.00321.04
8.2.100.0100.00317.66
8.2.90.0030.00517.68
8.2.80.0000.00817.97
8.2.70.0030.00517.93
8.2.60.0070.00018.22
8.2.50.0000.00818.10
8.2.40.0000.00719.47
8.2.30.0070.00019.31
8.2.20.0080.00018.04
8.2.10.0040.00418.16
8.2.00.0030.00517.65
8.1.280.0110.00725.92
8.1.270.0060.00320.73
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0110.00022.27
8.1.230.0070.00422.69
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0090.00317.21
8.1.190.0040.00417.41
8.1.180.0090.00018.10
8.1.170.0030.00618.61
8.1.160.0040.00418.89
8.1.150.0050.00318.81
8.1.140.0040.00422.18
8.1.130.0070.00020.30
8.1.120.0000.00717.46
8.1.110.0030.00517.48
8.1.100.0040.00417.39
8.1.90.0070.00017.45
8.1.80.0040.00417.32
8.1.70.0000.00717.48
8.1.60.0030.00517.47
8.1.50.0030.00617.57
8.1.40.0040.00417.52
8.1.30.0040.00417.47
8.1.20.0000.00917.54
8.1.10.0000.00817.41
8.1.00.0050.00317.46
8.0.300.0030.00721.36
8.0.290.0040.00416.75
8.0.280.0030.00518.55
8.0.270.0040.00417.24
8.0.260.0030.00318.52
8.0.250.0030.00316.87
8.0.240.0030.00316.93
8.0.230.0000.00816.86
8.0.220.0000.00716.90
8.0.210.0070.00016.93
8.0.200.0000.00716.93
8.0.190.0040.00416.88
8.0.180.0040.00416.87
8.0.170.0040.00416.87
8.0.160.0040.00417.00
8.0.150.0080.00016.79
8.0.140.0000.00816.86
8.0.130.0000.00513.27
8.0.120.0030.00616.78
8.0.110.0000.00716.95
8.0.100.0050.00216.80
8.0.90.0030.00316.73
8.0.80.0100.00916.87
8.0.70.0040.00416.88
8.0.60.0000.00716.96
8.0.50.0050.00216.92
8.0.30.0100.00717.12
8.0.20.0100.00817.40
8.0.10.0000.00716.98
8.0.00.0140.00516.62
7.4.330.0000.00515.55
7.4.320.0060.00016.55
7.4.300.0060.00016.48
7.4.290.0000.00716.57
7.4.280.0080.00016.54
7.4.270.0030.00316.45
7.4.260.0000.00716.45
7.4.250.0000.00716.37
7.4.240.0050.00216.61
7.4.230.0030.00316.68
7.4.220.0080.00016.34
7.4.210.0080.00816.51
7.4.200.0000.00816.59
7.4.160.0070.01016.44
7.4.140.0090.00917.86
7.4.130.0030.01616.56
7.4.120.0090.00816.50
7.4.110.0120.00816.59
7.4.100.0170.00016.64
7.4.90.0140.00316.43
7.4.80.0160.00319.39
7.4.70.0030.01316.48
7.4.60.0070.01016.46
7.4.50.0040.00816.07
7.4.40.0090.00616.34
7.4.00.0060.00315.07
7.3.330.0030.00313.07
7.3.320.0030.00313.01
7.3.310.0050.00516.17
7.3.300.0050.00216.32
7.3.290.0030.00316.32
7.3.280.0080.00916.30
7.3.260.0110.00916.40
7.3.240.0130.01016.39
7.3.230.0040.01216.36
7.3.210.0130.00316.55
7.3.200.0090.00616.22
7.3.190.0150.00616.44
7.3.180.0060.01016.71
7.3.170.0090.01316.49
7.3.160.0060.01116.49
7.2.330.0060.01216.63
7.2.320.0170.00616.59
7.2.310.0110.00716.48
7.2.300.0130.00316.58
7.2.290.0130.00316.63
7.2.110.0120.01514.88
7.2.100.0300.01014.82
7.2.90.0280.00914.42
7.2.80.0250.00614.65
7.2.70.0220.00915.22
7.2.60.0200.01014.60
7.2.50.0270.00014.90
7.2.40.0320.00615.04
7.2.30.0190.00914.73
7.2.20.0220.00814.64
7.2.10.0280.00314.95
7.2.00.0210.00714.86
7.1.230.0300.00314.08
7.1.220.0190.00613.86
7.1.210.0330.00614.00
7.1.200.0270.00714.02
7.1.190.0290.01313.63
7.1.180.1170.01013.86
7.1.170.0230.00613.71
7.1.160.0210.00913.90
7.1.150.0290.00613.97
7.1.140.0250.00613.82
7.1.130.0240.00313.80
7.1.120.0160.01613.88
7.1.110.0190.01013.95
7.1.100.0350.00613.89
7.1.90.0420.00013.91
7.1.80.0300.00213.86
7.1.70.0270.00314.01
7.1.60.0480.01031.67
7.1.50.0390.00731.77
7.1.40.0370.01331.76
7.1.30.0510.01331.78
7.1.20.0360.01331.73
7.1.10.0250.00613.60
7.1.00.0170.01013.77
5.6.380.0080.00614.16

preferences:
63.05 ms | 400 KiB | 5 Q