3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['p' => ['id' => TRUE]]; $b = ['p' => FALSE]; print "Behaves as expected.\n"; var_dump(array_merge_recursive($a, $b)); print "\n\nOMG internal array pointer shenanigans can affect the results of array_merge_recursive()!\n"; $a['p'][0] = 'SOMETHING, anything!'; unset($a['p'][0]); var_dump(array_merge_recursive($a, $b)); print "\n\nThis keeps happening…\n"; var_dump(array_merge_recursive($a, $b)); print "\n\n… not even resetting the internal array pointer helps …\n"; reset($a['p']); var_dump(array_merge_recursive($a, $b)); print "\n\n… nor casting to object, cloning, then back to array …\n"; $a['p'] = (array) clone (object) $a['p']; var_dump(array_merge_recursive($a, $b)); print "\n\n… only forcefully recreating a copy-by-value of the array by using array_slice().\n"; $a['p'] = array_slice($a['p'], 0); var_dump(array_merge_recursive($a, $b));

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.5.10.0120.00818.61
8.5.00.0120.01019.83
8.4.150.0020.00014.05
8.4.140.0150.00617.90
8.4.130.0150.00519.49
8.4.120.0040.00522.29
8.4.110.0100.01118.70
8.4.100.0130.00718.98
8.4.90.0100.00920.59
8.4.80.0040.00420.75
8.4.70.0150.00719.04
8.4.60.0150.00718.74
8.4.50.0050.00418.61
8.4.40.0040.00419.61
8.4.30.0040.00418.71
8.4.20.0070.00417.63
8.4.10.0090.00922.25
8.3.280.0140.00618.49
8.3.270.0130.00716.38
8.3.260.0070.01116.79
8.3.250.0110.00818.80
8.3.240.0100.01018.79
8.3.230.0110.00916.55
8.3.220.0140.00519.18
8.3.210.0050.00316.74
8.3.200.0050.00416.81
8.3.190.0110.00817.18
8.3.180.0120.00618.86
8.3.170.0050.01016.73
8.3.160.0130.00717.23
8.3.150.0030.00717.04
8.3.140.0120.00620.83
8.3.130.0090.00918.32
8.3.120.0150.00018.81
8.3.110.0110.00020.94
8.3.100.0100.00024.06
8.3.90.0120.00326.77
8.3.80.0030.00616.50
8.3.70.0150.00016.58
8.3.60.0130.00618.53
8.3.50.0100.00718.37
8.3.40.0120.00318.95
8.3.30.0110.00419.47
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0030.00526.16
8.2.290.0070.00220.50
8.2.280.0120.00718.49
8.2.270.0160.00316.48
8.2.260.0180.00016.75
8.2.250.0070.01316.66
8.2.240.0120.00319.07
8.2.230.0080.00022.58
8.2.220.0080.00037.54
8.2.210.0030.00626.77
8.2.200.0040.00416.63
8.2.190.0030.01218.41
8.2.180.0130.00325.92
8.2.170.0140.00718.95
8.2.160.0180.00022.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0070.00726.16
8.2.120.0100.00026.16
8.2.110.0040.00420.48
8.2.100.0160.00017.72
8.2.90.0070.00419.21
8.2.80.0050.00318.03
8.2.70.0040.00717.63
8.2.60.0000.00918.15
8.2.50.0090.00018.07
8.2.40.0060.00320.06
8.2.30.0040.00418.10
8.2.20.0050.00220.40
8.2.10.0040.00417.97
8.2.00.0040.00419.15
8.1.330.0100.00915.95
8.1.320.0070.00316.17
8.1.310.0030.01317.85
8.1.300.0060.00318.64
8.1.290.0050.00530.84
8.1.280.0170.00325.92
8.1.270.0050.00324.66
8.1.260.0110.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.90
8.1.230.0070.00417.77
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0050.00517.22
8.1.190.0000.00917.22
8.1.180.0000.00818.10
8.1.170.0030.00518.58
8.1.160.0080.00018.77
8.1.150.0070.00018.48
8.1.140.0040.00417.48
8.1.130.0040.00418.77
8.1.120.0040.00417.41
8.1.110.0000.00817.42
8.1.100.0040.00417.48
8.1.90.0030.00517.47
8.1.80.0040.00417.41
8.1.70.0070.00317.56
8.1.60.0030.00617.62
8.1.50.0040.00617.45
8.1.40.0170.00717.42
8.1.30.0190.00617.73
8.1.20.0250.00017.56
8.1.10.0220.00417.61
8.1.00.0170.00817.41
8.0.300.0070.00018.77
8.0.290.0070.00016.63
8.0.280.0030.00318.41
8.0.270.0030.00317.91
8.0.260.0030.00318.47
8.0.250.0040.00416.93
8.0.240.0000.00716.90
8.0.230.0040.00416.88
8.0.220.0000.00716.86
8.0.210.0000.00716.75
8.0.200.0030.00316.85
8.0.190.0000.00816.93
8.0.180.0070.01016.70
8.0.170.0040.00416.82
8.0.160.0090.00416.88
8.0.150.0080.00816.84
8.0.140.0100.00316.75
8.0.130.0140.00316.68
8.0.120.0110.00816.83
8.0.110.0080.00516.82
8.0.100.0100.00716.77
8.0.90.0190.00316.69
8.0.80.0070.00716.82
8.0.70.0090.00916.69
8.0.60.0170.00316.71
8.0.50.0130.00616.77
8.0.30.0050.01116.81
8.0.20.0080.00616.89
8.0.10.0110.00316.90
7.4.330.0000.00615.55
7.4.320.0000.00716.50
7.4.300.0070.00016.52
7.4.290.0090.00416.56
7.4.280.0160.00616.57
7.4.270.0190.00416.53
7.4.260.0130.01016.63
7.4.250.0170.00716.61
7.4.240.0180.00516.52
7.4.230.0200.00316.46
7.4.220.0130.00816.63
7.4.210.0130.00716.37
7.4.200.0160.00416.58
7.4.190.0100.00916.51
7.4.180.0200.00016.58
7.4.160.0170.00316.66
7.4.150.0200.00016.53
7.4.140.0190.00516.38
7.4.130.0220.00416.44
7.4.120.0170.00916.47
7.4.110.0180.00316.45
7.4.100.0150.00816.36
7.4.90.0110.00816.34
7.4.80.0160.00316.51
7.4.70.0170.00316.53
7.4.60.0160.00316.48
7.4.50.0150.00416.40
7.4.40.0190.00016.48
7.4.30.0190.00016.55
7.4.20.0040.00416.45
7.4.10.0200.00016.38
7.4.00.0190.00016.45

preferences:
36.7 ms | 403 KiB | 5 Q