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])) { echo 1; $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.60.0030.01018.43
8.3.50.0120.00918.29
8.3.40.0040.01218.55
8.3.30.0070.00718.73
8.3.20.0050.00221.94
8.3.10.0040.00421.80
8.3.00.0000.00819.80
8.2.180.0140.00716.75
8.2.170.0090.00622.96
8.2.160.0090.00619.51
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00319.44
8.2.120.0040.00426.35
8.2.110.0030.00721.07
8.2.100.0090.00017.91
8.2.90.0030.00518.03
8.2.80.0040.00418.20
8.2.70.0080.00017.68
8.2.60.0030.00617.90
8.2.50.0030.00518.12
8.2.40.0050.00320.59
8.2.30.0030.00519.23
8.2.20.0050.00318.02
8.2.10.0040.00418.13
8.2.00.0000.00818.11
8.1.280.0130.00625.92
8.1.270.0000.00823.83
8.1.260.0050.00326.35
8.1.250.0090.00028.09
8.1.240.0060.00323.88
8.1.230.0090.00320.96
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0050.00317.13
8.1.180.0040.00418.10
8.1.170.0000.00818.59
8.1.160.0040.00418.90
8.1.150.0040.00420.81
8.1.140.0050.00217.70
8.1.130.0040.00419.02
8.1.120.0030.00317.44
8.1.110.0040.00417.48
8.1.100.0050.00217.42
8.1.90.0000.01117.50
8.1.80.0040.00417.49
8.1.70.0000.00717.43
8.1.60.0080.00017.54
8.1.50.0030.00517.55
8.1.40.0040.00417.51
8.1.30.0000.01017.59
8.1.20.0040.00417.70
8.1.10.0030.00517.61
8.1.00.0050.00317.37
8.0.300.0050.00219.86
8.0.290.0020.00516.75
8.0.280.0030.00318.45
8.0.270.0070.00017.25
8.0.260.0000.00717.14
8.0.250.0070.00016.93
8.0.240.0000.01116.85
8.0.230.0040.00717.02
8.0.220.0000.00716.77
8.0.210.0030.00316.88
8.0.200.0070.00416.95
8.0.190.0030.00516.93
8.0.180.0000.00716.86
8.0.170.0030.00616.80
8.0.160.0000.00716.94
8.0.150.0000.00816.73
8.0.140.0040.00416.91
8.0.130.0000.00613.39
8.0.120.0030.00516.87
8.0.110.0040.00416.80
8.0.100.0050.00216.71
8.0.90.0050.00316.88
8.0.80.0090.00616.82
8.0.70.0080.00016.79
8.0.60.0070.00016.76
8.0.50.0040.00416.75
8.0.30.0110.00917.02
8.0.20.0130.00817.40
8.0.10.0000.00716.91
8.0.00.0080.01316.67
7.4.330.0000.00516.70
7.4.320.0030.00616.59
7.4.300.0060.00016.49
7.4.290.0030.00316.59
7.4.280.0080.00016.61
7.4.270.0000.00716.61
7.4.260.0030.00316.56
7.4.250.0000.00716.46
7.4.240.0050.00216.49
7.4.230.0030.00316.41
7.4.220.0040.00416.49
7.4.210.0100.00916.53
7.4.200.0000.00716.67
7.4.160.0090.00616.60
7.4.140.0120.00917.86
7.4.130.0100.01016.76
7.4.120.0080.01016.54
7.4.110.0070.01016.48
7.4.100.0100.00716.39
7.4.90.0100.00716.43
7.4.80.0070.01619.39
7.4.70.0110.00616.63
7.4.60.0120.00316.29
7.4.50.0060.01216.48
7.4.40.0120.00916.35
7.4.00.0070.00715.10
7.3.330.0050.00013.15
7.3.320.0060.00013.08
7.3.310.0000.00716.17
7.3.300.0080.00016.14
7.3.290.0000.00816.18
7.3.280.0080.00916.29
7.3.260.0080.00916.40
7.3.240.0110.00716.48
7.3.230.0150.00316.39
7.3.210.0090.01216.48
7.3.200.0060.00916.57
7.3.190.0060.01516.67
7.3.180.0130.00316.53
7.3.170.0120.00816.59
7.3.160.0080.00816.59
7.2.330.0070.01716.54
7.2.320.0070.01616.58
7.2.310.0060.01216.47
7.2.300.0060.01316.79
7.2.290.0090.01216.76
7.2.60.0100.01616.86
7.2.40.0120.01517.86
7.2.30.0130.01717.94
7.2.20.0140.01417.79
7.2.10.0180.01617.91
7.2.00.5030.01518.16
7.1.200.0030.01015.93
7.1.160.0160.00716.64
7.1.150.0180.00916.42
7.1.140.0230.01516.79
7.1.130.0190.01116.41
7.1.120.0160.01216.76
7.1.110.8010.01316.14
7.1.101.0180.01416.18
7.1.90.0320.01315.94
7.1.80.0140.01116.16
7.1.70.0140.01115.53
7.1.60.0310.01433.01
7.1.50.0310.01533.09
7.1.40.0310.01332.68
7.1.30.0390.01932.58
7.1.20.0280.01932.97
7.1.10.0340.01615.01
7.1.00.0090.01014.71

preferences:
61.97 ms | 401 KiB | 5 Q