3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['read' => [1,2]]; $b = ['read' => [2,3]]; $c = array_replace($b, $a); foreach ($c as $key => $value) { if (is_array($value) && isset($b[$key])) { $c[$key] = array_unique(array_replace($value, $b[$key])); } elseif (empty($value) && isset($b[$key])) { $c[$key] = $b[$key]; } } var_dump($c);

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.70.0120.00618.30
8.3.60.0120.00318.43
8.3.50.0070.00718.27
8.3.40.0090.00618.58
8.3.30.0110.00418.63
8.3.20.0040.00421.77
8.3.10.0040.00421.82
8.3.00.0050.00319.78
8.2.190.0170.00316.58
8.2.180.0140.00316.32
8.2.170.0070.01122.96
8.2.160.0140.00021.19
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00719.38
8.2.120.0050.00226.35
8.2.110.0040.00421.04
8.2.100.0060.00617.78
8.2.90.0030.00618.03
8.2.80.0000.00818.16
8.2.70.0040.00417.93
8.2.60.0040.00417.93
8.2.50.0040.00418.22
8.2.40.0030.00520.61
8.2.30.0000.00819.45
8.2.20.0000.00918.00
8.2.10.0020.00518.06
8.2.00.0030.00618.13
8.1.280.0000.01525.92
8.1.270.0060.00323.67
8.1.260.0040.00426.35
8.1.250.0000.01128.09
8.1.240.0060.00622.03
8.1.230.0070.00320.78
8.1.220.0040.00417.91
8.1.210.0090.00018.77
8.1.200.0060.00317.48
8.1.190.0090.00017.35
8.1.180.0050.00318.10
8.1.170.0000.00818.53
8.1.160.0000.00818.80
8.1.150.0040.00419.08
8.1.140.0000.00717.75
8.1.130.0000.00818.89
8.1.120.0070.00017.50
8.1.110.0030.00517.43
8.1.100.0030.00617.45
8.1.90.0110.00017.39
8.1.80.0050.00317.30
8.1.70.0030.00617.36
8.1.60.0030.00617.59
8.1.50.0030.00517.39
8.1.40.0040.00417.54
8.1.30.0080.00417.55
8.1.20.0040.00417.57
8.1.10.0070.00017.39
8.1.00.0040.00417.48
8.0.300.0000.00820.03
8.0.290.0040.00416.63
8.0.280.0050.00218.45
8.0.270.0000.00717.26
8.0.260.0040.00417.21
8.0.250.0030.00317.01
8.0.240.0030.00716.97
8.0.230.0060.00316.86
8.0.220.0000.00716.79
8.0.210.0030.00316.77
8.0.200.0060.00316.97
8.0.190.0050.00216.93
8.0.180.0030.00316.85
8.0.170.0040.00416.75
8.0.160.0030.00316.89
8.0.150.0000.00716.91
8.0.140.0000.00716.76
8.0.130.0030.00313.27
8.0.120.0000.00716.77
8.0.110.0000.00716.92
8.0.100.0040.00416.72
8.0.90.0000.00716.75
8.0.80.0090.01216.83
8.0.70.0080.00016.83
8.0.60.0030.00516.92
8.0.50.0000.00716.72
8.0.30.0070.01017.08
8.0.20.0110.00917.40
8.0.10.0050.00217.01
8.0.00.0140.00316.86
7.4.330.0000.00516.66
7.4.320.0070.00216.52
7.4.300.0000.00716.65
7.4.290.0000.00716.57
7.4.280.0080.00016.58
7.4.270.0040.00416.43
7.4.260.0040.00416.56
7.4.250.0040.00416.52
7.4.240.0000.00716.49
7.4.230.0040.00416.66
7.4.220.0040.00416.59
7.4.210.0090.00516.51
7.4.200.0030.00316.71
7.4.160.0050.01216.58
7.4.140.0090.01017.86
7.4.130.0130.00716.52
7.4.120.0080.00916.55
7.4.110.0120.00816.56
7.4.100.0060.01016.48
7.4.90.0060.01016.48
7.4.80.0110.01519.39
7.4.70.0090.00616.39
7.4.60.0060.01016.39
7.4.50.0060.00616.52
7.4.40.0060.00916.21
7.4.00.0090.00615.01
7.3.330.0000.00513.17
7.3.320.0000.00613.16
7.3.310.0000.00816.27
7.3.300.0050.00216.36
7.3.290.0000.00716.28
7.3.280.0070.01016.39
7.3.260.0080.01016.46
7.3.240.0100.00716.47
7.3.230.0140.00616.64
7.3.210.0100.00716.44
7.3.200.0100.00616.48
7.3.190.0000.01616.49
7.3.180.0090.00916.57
7.3.170.0120.00416.50
7.3.160.0060.00916.38
7.3.10.0090.00516.64
7.3.00.0060.00516.62
7.2.330.0140.01116.50
7.2.320.0160.00416.75
7.2.310.0110.00716.80
7.2.300.0040.01816.86
7.2.290.0150.00316.63
7.2.130.0060.00316.94
7.2.120.0020.01216.98
7.2.110.0070.00516.88
7.2.100.0090.00616.83
7.2.90.0030.01016.99
7.2.80.0060.00716.97
7.2.70.0070.00716.98
7.2.60.0080.00816.75
7.2.50.0100.00516.92
7.2.40.1830.00917.30
7.2.30.1510.01017.44
7.2.20.1420.00817.34
7.2.10.1310.01217.33
7.2.00.0970.00717.42
7.1.250.0050.00715.70
7.1.240.0000.01015.50
7.1.230.0030.01015.67
7.1.220.0000.01015.56
7.1.210.0000.01015.80
7.1.200.0050.00515.72
7.1.190.0030.01215.45
7.1.180.0000.01415.88
7.1.170.0070.00715.66
7.1.160.1970.01016.44
7.1.150.2190.00716.30
7.1.140.2470.00816.41
7.1.130.1850.01016.10
7.1.120.1330.00816.21
7.1.110.2630.00815.73
7.1.100.2750.00716.19
7.1.90.3870.01016.13
7.1.80.3110.00816.00
7.1.70.2790.00615.48
7.1.60.2300.01224.43
7.1.50.3480.01324.43
7.1.40.3470.01024.22
7.1.30.0600.01424.19
7.1.20.0190.01124.19
7.1.10.0120.00815.25
7.1.00.0080.01415.22
7.0.330.0030.00915.35
5.6.380.0030.00614.50

preferences:
19.23 ms | 401 KiB | 5 Q