3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('element1' => array('subelement1'=>'value','subelement2'=>array('sub21'=>'hello')), 'element2'=>array('something'=>'this','subelement1'=>'awesome','subelement2'=>array('sub21'=>'world'))); function deepReplace($searchPath, $newValue, &$array) { if (count($searchPath) == 0) { $array = $newValue; } $lookFor = array_shift($searchPath); if (is_array($array) && array_key_exists($lookFor, $array)) { deepReplace($searchPath, $newValue, $array[$lookFor]); } } print_r($data); deepReplace(array("element1", "subelement1"), "newValue", $data); print_r($data);

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.40.0100.00718.76
8.3.30.0070.00719.23
8.3.20.0080.00020.27
8.3.10.0000.00823.66
8.3.00.0080.00020.64
8.2.170.0110.00322.96
8.2.160.0100.00322.16
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0000.00822.12
8.2.110.0070.00322.16
8.2.100.0070.00717.72
8.2.90.0030.00619.35
8.2.80.0040.00418.05
8.2.70.0000.00817.50
8.2.60.0090.00317.93
8.2.50.0000.00818.07
8.2.40.0070.00019.18
8.2.30.0040.00418.21
8.2.20.0000.00817.70
8.2.10.0000.00819.44
8.2.00.0040.00417.73
8.1.270.0090.00023.71
8.1.260.0050.00226.35
8.1.250.0000.00828.09
8.1.240.0030.00623.69
8.1.230.0070.00319.20
8.1.220.0080.00017.79
8.1.210.0080.00018.77
8.1.200.0070.00717.23
8.1.190.0000.00817.51
8.1.180.0040.00418.10
8.1.170.0030.00618.53
8.1.160.0050.00321.99
8.1.150.0000.00718.55
8.1.140.0040.00417.43
8.1.130.0000.00717.87
8.1.120.0000.00717.36
8.1.110.0020.00517.44
8.1.100.0000.00717.52
8.1.90.0100.00017.36
8.1.80.0030.00317.48
8.1.70.0030.00317.34
8.1.60.0080.00017.55
8.1.50.0040.00417.54
8.1.40.0040.00417.52
8.1.30.0000.00817.50
8.1.20.0040.00417.66
8.1.10.0000.00817.47
8.1.00.0000.00817.36
8.0.300.0040.00418.77
8.0.290.0000.00717.16
8.0.280.0030.00318.45
8.0.270.0000.00717.36
8.0.260.0000.00716.82
8.0.250.0030.00316.87
8.0.240.0050.00216.96
8.0.230.0000.00716.90
8.0.220.0030.00316.77
8.0.210.0030.00316.85
8.0.200.0070.00317.01
8.0.190.0040.00416.83
8.0.180.0000.00816.95
8.0.170.0050.00316.96
8.0.160.0050.00316.77
8.0.150.0070.00016.84
8.0.140.0000.00716.87
8.0.130.0030.00313.28
8.0.120.0050.00316.88
8.0.110.0050.00316.78
8.0.100.0000.00716.93
8.0.90.0040.00416.76
8.0.80.0030.01616.94
8.0.70.0030.00516.96
8.0.60.0030.00516.87
8.0.50.0000.00716.91
8.0.30.0100.01016.96
8.0.20.0060.01217.40
8.0.10.0040.00416.85
8.0.00.0120.00616.68
7.4.330.0030.00315.18
7.4.320.0000.00616.67
7.4.300.0030.00316.65
7.4.290.0040.00416.61
7.4.280.0000.00716.49
7.4.270.0060.00016.52
7.4.260.0030.00316.54
7.4.250.0030.00316.36
7.4.240.0020.00516.59
7.4.230.0000.00716.60
7.4.220.0100.01016.69
7.4.210.0080.00716.49
7.4.200.0030.00316.48
7.4.190.0040.00416.58
7.4.160.0080.00816.52
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0090.01016.43
7.4.120.0130.00716.53
7.4.110.0070.01116.63
7.4.100.0110.00716.54
7.4.90.0070.01016.58
7.4.80.0130.01016.60
7.4.70.0110.00716.51
7.4.60.0070.01016.61
7.4.50.0000.00416.52
7.4.40.0040.01422.77
7.4.30.0080.00816.46
7.4.00.0140.00315.05
7.3.330.0030.00313.23
7.3.320.0000.00513.21
7.3.310.0070.00016.26
7.3.300.0030.00316.33
7.3.290.0070.01316.30
7.3.280.0060.01116.39
7.3.270.0130.00417.40
7.3.260.0120.00616.52
7.3.250.0090.01216.66
7.3.240.0080.00816.61
7.3.230.0090.00616.45
7.3.210.0120.00916.59
7.3.200.0140.00319.39
7.3.190.0080.01516.43
7.3.180.0040.01116.35
7.3.170.0080.00816.32
7.3.160.0120.00616.43
7.3.120.0100.00314.90
7.2.330.0130.00616.79
7.2.320.0050.01316.54
7.2.310.0140.00316.82
7.2.300.0060.01616.81
7.2.290.0140.00316.63
7.2.00.0090.00419.07
7.1.100.0080.00817.98
7.1.70.0000.00817.21
7.1.60.0070.01819.29
7.1.50.0030.02016.90
7.1.00.0070.07022.51
7.0.200.0060.00616.77
7.0.140.0030.07322.00
7.0.60.0130.07019.94
7.0.50.0130.04717.97
7.0.40.0070.05020.40
7.0.30.0400.04320.08
7.0.20.0270.05320.15
7.0.10.0270.08720.18
7.0.00.0000.04320.18
5.6.280.0070.07321.10
5.6.210.0070.06720.50
5.6.200.0030.08318.18
5.6.190.0030.05720.63
5.6.180.0430.08020.55
5.6.170.0200.04320.49
5.6.160.0070.08020.57
5.6.150.0030.04718.29
5.6.140.0070.08318.25
5.6.130.0200.07018.14
5.6.120.0070.08021.05
5.6.110.0100.07021.00
5.6.100.0130.07020.98
5.6.90.0070.08321.13
5.6.80.0130.04720.37
5.6.70.0330.06320.28
5.5.350.0000.09020.52
5.5.340.0070.03718.07
5.5.330.0100.08020.37
5.5.320.0100.07720.27
5.5.310.0170.04720.51
5.5.300.0070.04017.92
5.5.290.0100.08017.96
5.5.280.0070.05020.81
5.5.270.0130.05020.76
5.5.260.0030.08720.80
5.5.250.0130.07020.68
5.5.240.0030.04020.04
5.4.450.0930.04019.41
5.4.440.0270.05019.45
5.4.430.0200.05719.38
5.4.420.0270.06019.60
5.4.410.0270.04318.92
5.4.400.0170.05018.84
5.4.390.0070.06318.59
5.4.380.0200.06318.53
5.4.370.0130.05018.66
5.4.360.0200.04718.73
5.4.350.0100.06318.61
5.4.340.0130.05318.74
5.4.320.0070.03412.50
5.4.310.0070.03712.50
5.4.300.0080.03912.51
5.4.290.0060.03812.50
5.4.280.0090.05312.38
5.4.270.0140.06212.37
5.4.260.0150.09012.37
5.4.250.0100.04612.37
5.4.240.0060.04512.37
5.4.230.0060.05512.36
5.4.220.0090.04112.36
5.4.210.0100.05912.36
5.4.200.0080.06012.36
5.4.190.0130.05712.36
5.4.180.0060.04812.36
5.4.170.0060.04512.37
5.4.160.0160.05212.37
5.4.150.0110.03712.36
5.4.140.0060.04512.04
5.4.130.0060.04212.04
5.4.120.0180.05111.99
5.4.110.0120.06611.99
5.4.100.0080.08411.98
5.4.90.0170.06611.98
5.4.80.0090.05211.98
5.4.70.0110.08411.98
5.4.60.0180.07711.98
5.4.50.0130.08311.98
5.4.40.0160.08711.96
5.4.30.0190.08011.96
5.4.20.0220.07511.96
5.4.10.0200.09911.96
5.4.00.0140.05211.45
5.3.290.0070.03812.80
5.3.280.0110.06912.71
5.3.270.0200.08012.72
5.3.260.0150.05912.72
5.3.250.0240.11012.72
5.3.240.0230.09812.72
5.3.230.0070.05512.71
5.3.220.0120.04712.68
5.3.210.0150.06412.68
5.3.200.0140.04612.68
5.3.190.0110.04912.68
5.3.180.0120.04512.68
5.3.170.0170.04612.67
5.3.160.0100.07412.67
5.3.150.0160.06312.68
5.3.140.0120.08612.66
5.3.130.0110.08312.65
5.3.120.0170.07912.66
5.3.110.0110.07712.66
5.3.100.0130.08312.12
5.3.90.0120.07912.08
5.3.80.0080.08812.07
5.3.70.0150.09212.07
5.3.60.0120.07112.06
5.3.50.0210.08112.00
5.3.40.0150.05012.00
5.3.30.0140.09111.96
5.3.20.0080.04811.74
5.3.10.0060.05211.70
5.3.00.0110.05011.70
5.2.170.0050.0559.19
5.2.160.0120.0369.19
5.2.150.0100.0409.19
5.2.140.0100.0429.19
5.2.130.0070.0429.14
5.2.120.0080.0409.14
5.2.110.0090.0339.15
5.2.100.0070.0409.15
5.2.90.0100.0379.14
5.2.80.0200.0789.14
5.2.70.0070.0429.14
5.2.60.0120.0399.09
5.2.50.0050.0339.07
5.2.40.0070.0299.04
5.2.30.0080.0349.02
5.2.20.0090.0449.00
5.2.10.0150.0698.92
5.2.00.0110.0428.79
5.1.60.0070.0498.07
5.1.50.0110.0588.07
5.1.40.0100.0458.05
5.1.30.0080.0368.39
5.1.20.0090.0368.42
5.1.10.0090.0328.14
5.1.00.0070.0368.14
5.0.50.0080.0796.63
5.0.40.0130.0466.49
5.0.30.0120.0486.29
5.0.20.0100.0306.26
5.0.10.0090.0416.25
5.0.00.0140.0616.23
4.4.90.0080.0364.78
4.4.80.0070.0194.75
4.4.70.0070.0194.75
4.4.60.0060.0234.75
4.4.50.0050.0334.77
4.4.40.0080.0354.71
4.4.30.0080.0424.76
4.4.20.0070.0364.85
4.4.10.0050.0164.84
4.4.00.0060.0314.76
4.3.110.0040.0174.67
4.3.100.0060.0204.66
4.3.90.0050.0264.64
4.3.80.0050.0244.59
4.3.70.0040.0164.63
4.3.60.0050.0144.63
4.3.50.0030.0174.63
4.3.40.0040.0254.54
4.3.30.0030.0173.29
4.3.20.0050.0163.28
4.3.10.0040.0163.23
4.3.00.0070.01713.64

preferences:
56.88 ms | 400 KiB | 5 Q