3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ 5 => 'PHM', 4 => 'ODM', 3 => 'N', 6 => 'M9', 10 => 'RDM9', ]; $arr2 = [ 0 => '01', 1 => '02', 2 => '03', 3 => '04', 4 => '05', 5 => '06', 6 => '07', 7 => '08', 8 => '09', 9 => '10', 10 => '11', 11 => '12', 12 => '13', ]; var_export( array_replace(array_map(fn() => null, $arr2), $arr1) ); echo "\n---\n"; var_export( array_reduce( array_keys($arr2), fn($result, $k) => $result + [$k => $arr1[$k] ?? null], [] ) ); echo "\n---\n"; $result = []; foreach ($arr2 as $k => $_) { $result[$k] = $arr1[$k] ?? null; } var_export($result);

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.4.130.0130.00717.83
8.4.120.0130.00620.40
8.4.110.0130.00720.46
8.4.100.0120.00818.94
8.4.90.0120.01017.88
8.4.80.0100.01017.97
8.4.70.0120.00817.82
8.4.60.0110.00924.06
8.4.50.0080.00520.13
8.4.40.0100.01017.50
8.4.30.0160.00320.46
8.4.20.0180.00320.99
8.4.10.0030.00619.46
8.3.260.0100.00716.75
8.3.250.0110.00818.79
8.3.240.0050.00316.82
8.3.230.0110.00816.62
8.3.220.0050.00316.61
8.3.210.0070.00818.46
8.3.200.0060.00316.54
8.3.190.0120.00817.26
8.3.180.0130.00516.85
8.3.170.0070.01117.32
8.3.160.0150.00317.11
8.3.150.0050.00517.61
8.3.140.0060.00916.64
8.3.130.0320.01016.44
8.3.120.0360.00616.18
8.3.110.0340.00716.49
8.3.100.0350.01316.18
8.3.90.0430.00316.50
8.3.80.0430.00316.48
8.3.70.0400.00616.54
8.3.60.0390.00716.32
8.3.50.0290.01616.18
8.3.40.0330.00417.44
8.3.30.0270.00917.50
8.3.20.0360.00417.62
8.3.10.0250.01417.39
8.3.00.0330.00717.36
8.2.290.0080.00820.60
8.2.280.0120.00819.96
8.2.270.0190.00017.09
8.2.260.0120.00316.95
8.2.250.0300.00716.73
8.2.240.0120.00616.29
8.2.230.0150.00316.46
8.2.220.0140.00516.18
8.2.210.0320.00716.36
8.2.200.0320.00616.54
8.2.190.0190.01416.52
8.2.180.0290.01016.32
8.2.170.0370.00317.53
8.2.160.0470.00417.54
8.2.150.0450.00317.58
8.2.140.0410.00317.24
8.2.130.0150.00417.65
8.2.120.0160.00417.56
8.2.110.0120.00817.45
8.2.100.0150.00317.59
8.2.90.0090.00917.73
8.2.80.0180.00017.58
8.2.70.0140.00517.73
8.2.60.0180.00017.35
8.2.50.0360.00317.50
8.2.40.0310.00317.75
8.2.30.0240.00017.59
8.2.20.0170.00017.67
8.2.10.0180.00417.56
8.2.00.0290.00617.70
8.1.330.0100.01116.07
8.1.320.0090.01016.06
8.1.310.0040.00416.94
8.1.300.0260.00716.24
8.1.290.0400.00816.18
8.1.280.0380.00316.20
8.1.270.0320.01317.36
8.1.260.0330.01217.10
8.1.250.0420.00017.40
8.1.240.0290.00317.28
8.1.230.0140.00917.34
8.1.220.0180.00917.48
8.1.210.0280.00817.20
8.1.200.0290.00417.43
8.1.190.0290.01317.06
8.1.180.0250.01417.29
8.1.170.0290.00717.09
8.1.160.0340.00617.27
8.1.150.0250.00617.11
8.1.140.0260.00317.23
8.1.130.0220.01617.14
8.1.120.0230.01317.14
8.1.110.0240.00917.21
8.1.100.0220.00717.22
8.1.90.0190.00317.25
8.1.80.0150.00317.20
8.1.70.0180.00017.21
8.1.60.0300.01117.42
8.1.50.0280.01217.02
8.1.40.0260.01317.33
8.1.30.0360.00417.36
8.1.20.0370.00317.23
8.1.10.0300.01517.27
8.1.00.0410.00617.20

preferences:
30.14 ms | 403 KiB | 5 Q