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 var_export($found); $result = array_merge($result, $found); // store the new key(s) $B = array_intersect($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.00918.31
8.3.50.0090.00618.18
8.3.40.0070.01018.97
8.3.30.0110.00418.63
8.3.20.0090.00019.13
8.3.10.0050.00323.39
8.3.00.0000.01020.70
8.2.180.0070.00718.16
8.2.170.0090.00922.96
8.2.160.0070.00722.26
8.2.150.0090.00024.18
8.2.140.0080.00824.66
8.2.130.0070.00719.95
8.2.120.0090.00626.35
8.2.110.0070.00419.37
8.2.100.0120.00017.78
8.2.90.0030.00617.75
8.2.80.0080.00017.97
8.2.70.0060.00318.04
8.2.60.0090.00018.09
8.2.50.0040.00418.10
8.2.40.0040.00419.30
8.2.30.0050.00219.16
8.2.20.0000.00718.06
8.2.10.0030.00618.11
8.2.00.0000.00817.78
8.1.280.0100.00725.92
8.1.270.0070.00020.83
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.44
8.1.230.0060.00622.12
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0040.00417.12
8.1.190.0090.00017.23
8.1.180.0030.00618.10
8.1.170.0040.00418.69
8.1.160.0000.00818.88
8.1.150.0040.00418.83
8.1.140.0040.00422.05
8.1.130.0070.00020.17
8.1.120.0000.00817.46
8.1.110.0020.00517.45
8.1.100.0050.00217.36
8.1.90.0070.00017.35
8.1.80.0000.00817.39
8.1.70.0000.00717.48
8.1.60.0030.00617.55
8.1.50.0040.00417.52
8.1.40.0040.00417.56
8.1.30.0050.00317.65
8.1.20.0060.00317.64
8.1.10.0000.00817.51
8.1.00.0030.00617.30
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0040.00418.36
8.0.270.0060.00317.18
8.0.260.0000.00718.45
8.0.250.0070.00016.89
8.0.240.0000.00716.94
8.0.230.0030.00316.93
8.0.220.0000.00716.95
8.0.210.0040.00416.90
8.0.200.0040.00416.86
8.0.190.0040.00416.98
8.0.180.0000.00816.90
8.0.170.0040.00416.82
8.0.160.0070.00016.89
8.0.150.0070.00016.72
8.0.140.0040.00416.84
8.0.130.0000.00613.36
8.0.120.0040.00416.84
8.0.110.0000.00716.93
8.0.100.0000.00716.95
8.0.90.0070.00016.93
8.0.80.0060.00916.87
8.0.70.0040.00416.93
8.0.60.0040.00416.91
8.0.50.0040.00416.85
8.0.30.0080.01017.17
8.0.20.0120.00617.40
8.0.10.0090.00016.95
8.0.00.0130.00816.79
7.4.330.0000.00515.55
7.4.320.0030.00316.45
7.4.300.0040.00416.50
7.4.290.0030.00316.49
7.4.280.0030.00616.59
7.4.270.0030.00416.54
7.4.260.0000.00716.56
7.4.250.0050.00216.54
7.4.240.0040.00416.55
7.4.230.0000.00716.40
7.4.220.0070.00016.68
7.4.210.0110.00716.60
7.4.200.0070.00016.54
7.4.160.0090.00916.49
7.4.140.0120.00717.86
7.4.130.0110.00616.41
7.4.120.0100.00716.47
7.4.110.0130.00716.43
7.4.100.0130.00316.34
7.4.90.0120.00616.49
7.4.80.0030.01419.39
7.4.70.0110.00616.48
7.4.60.0130.00316.50
7.4.50.0070.00716.50
7.4.40.0090.00816.59
7.4.00.0110.00414.87
7.3.330.0050.00013.16
7.3.320.0060.00013.25
7.3.310.0060.00316.29
7.3.300.0030.00316.36
7.3.290.0030.00316.30
7.3.280.0050.01016.32
7.3.260.0080.00916.47
7.3.240.0110.00916.40
7.3.230.0080.00816.64
7.3.210.0040.01216.58
7.3.200.0170.00616.49
7.3.190.0090.01216.35
7.3.180.0170.00016.53
7.3.170.0100.01316.36
7.3.160.0060.01016.43
7.2.330.0070.01116.57
7.2.320.0120.01316.39
7.2.310.0070.01016.74
7.2.300.0080.00916.43
7.2.290.0030.01316.75
7.2.110.0160.00914.72
7.2.100.0240.00614.80
7.2.90.0190.00314.43
7.2.80.0180.00914.84
7.2.70.0180.01415.23
7.2.60.0100.01314.67
7.2.50.0140.01414.96
7.2.40.0180.01414.97
7.2.30.0270.00014.68
7.2.20.0210.00414.68
7.2.10.0170.00715.05
7.2.00.0260.00314.84
7.1.230.0160.01213.84
7.1.220.0220.00613.98
7.1.210.0160.01014.05
7.1.200.0230.00613.99
7.1.190.0150.00613.77
7.1.180.0180.00613.75
7.1.170.0120.00913.82
7.1.160.0250.00413.65
7.1.150.0240.00713.60
7.1.140.0130.00913.58
7.1.130.0200.00613.61
7.1.120.0240.00813.88
7.1.110.0270.00314.20
7.1.100.0270.00314.09
7.1.90.0220.00313.77
7.1.80.0210.00413.82
7.1.70.0180.00613.87
7.1.60.0420.01331.44
7.1.50.0360.01631.72
7.1.40.0360.01331.80
7.1.30.0540.00331.68
7.1.20.0330.00731.71
7.1.10.0240.00713.62
7.1.00.0180.00713.79
5.6.380.0070.00714.25

preferences:
35.86 ms | 400 KiB | 5 Q