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 ($lookFor === null) { foreach ($array as $value) { deepReplace($searchPath, $newValue, $value); } } else if (is_array($array) && array_key_exists($lookFor, $array)) { deepReplace($searchPath, $newValue, $array[$lookFor]); } } print_r($data); deepReplace(array(null, "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.60.0030.01016.50
8.3.50.0130.00722.11
8.3.40.0090.00618.79
8.3.30.0070.00719.11
8.3.20.0040.00420.33
8.3.10.0050.00323.66
8.3.00.0080.00020.53
8.2.180.0100.01316.75
8.2.170.0040.01122.96
8.2.160.0100.00322.13
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0000.00822.16
8.2.110.0090.00022.29
8.2.100.0000.01117.84
8.2.90.0040.00419.18
8.2.80.0000.00817.97
8.2.70.0050.00317.75
8.2.60.0030.00517.93
8.2.50.0060.00318.07
8.2.40.0040.00419.46
8.2.30.0050.00318.01
8.2.20.0070.00017.79
8.2.10.0040.00419.51
8.2.00.0040.00417.74
8.1.280.0040.01125.92
8.1.270.0090.00022.16
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.66
8.1.230.0090.00319.16
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0050.00318.56
8.1.160.0050.00322.09
8.1.150.0040.00418.50
8.1.140.0040.00417.52
8.1.130.0030.00617.37
8.1.120.0030.00317.50
8.1.110.0070.00017.34
8.1.100.0040.00417.47
8.1.90.0030.00317.42
8.1.80.0030.00317.43
8.1.70.0030.00317.39
8.1.60.0060.00317.48
8.1.50.0040.00417.43
8.1.40.0080.00017.51
8.1.30.0030.00517.47
8.1.20.0040.00417.53
8.1.10.0040.00417.48
8.1.00.0050.00317.45
8.0.300.0080.00018.77
8.0.290.0070.00016.92
8.0.280.0030.00318.36
8.0.270.0030.00317.32
8.0.260.0000.00716.89
8.0.250.0030.00316.95
8.0.240.0000.00717.00
8.0.230.0000.00717.05
8.0.220.0000.00716.92
8.0.210.0070.00016.93
8.0.200.0000.00717.04
8.0.190.0060.00317.07
8.0.180.0040.00416.99
8.0.170.0040.00416.92
8.0.160.0000.00816.91
8.0.150.0030.00316.83
8.0.140.0050.00316.91
8.0.130.0030.00313.36
8.0.120.0050.00316.93
8.0.110.0020.00516.85
8.0.100.0040.00416.76
8.0.90.0040.00416.79
8.0.80.0060.01016.96
8.0.70.0030.00516.95
8.0.60.0070.00016.79
8.0.50.0040.00416.96
8.0.30.0100.01017.20
8.0.20.0050.01317.40
8.0.10.0070.00017.11
8.0.00.0080.01216.73
7.4.330.0050.00015.00
7.4.320.0030.00316.50
7.4.300.0030.00316.61
7.4.290.0070.00016.52
7.4.280.0040.00416.61
7.4.270.0030.00316.65
7.4.260.0000.00716.58
7.4.250.0070.00016.56
7.4.240.0040.00316.61
7.4.230.0040.00416.41
7.4.220.0060.01216.46
7.4.210.0090.00716.51
7.4.200.0000.00716.68
7.4.190.0040.00416.48
7.4.160.0100.00516.53
7.4.150.0080.00917.40
7.4.140.0080.00917.86
7.4.130.0100.00716.53
7.4.120.0160.00516.50
7.4.110.0130.00316.34
7.4.100.0090.01216.46
7.4.90.0070.01016.39
7.4.80.0180.00616.40
7.4.70.0100.01016.44
7.4.60.0100.01016.52
7.4.50.0040.00416.42
7.4.40.0000.01522.77
7.4.30.0060.01016.57
7.4.00.0000.01414.68
7.3.330.0030.00313.30
7.3.320.0000.00513.30
7.3.310.0040.00416.34
7.3.300.0040.00416.26
7.3.290.0100.01016.45
7.3.280.0100.01016.39
7.3.270.0070.01817.40
7.3.260.0040.01816.52
7.3.250.0140.00716.55
7.3.240.0130.00316.62
7.3.230.0070.01016.39
7.3.210.0110.00716.42
7.3.200.0060.01219.39
7.3.190.0140.00316.44
7.3.180.0030.01216.49
7.3.170.0100.00616.48
7.3.160.0090.00616.38
7.3.120.0000.01415.11
7.2.330.0120.00616.85
7.2.320.0150.00916.86
7.2.310.0130.00616.89
7.2.300.0120.00816.59
7.2.290.0100.01316.80
7.2.00.0030.01019.24
7.1.100.0040.00818.14
7.1.70.0000.01217.16
7.1.60.0130.01019.29
7.1.50.0070.01716.96
7.1.00.0070.07322.33
7.0.200.0040.00816.72
7.0.140.0030.07322.11
7.0.60.0070.06320.10
7.0.50.0100.06017.87
7.0.40.0070.09020.13
7.0.30.0230.04320.13
7.0.20.0270.07720.24
7.0.10.0300.08320.16
7.0.00.0100.08320.13
5.6.280.0030.07321.12
5.6.210.0070.04020.72
5.6.200.0030.04018.14
5.6.190.0070.08720.57
5.6.180.0300.05020.44
5.6.170.0270.07020.47
5.6.160.0030.04320.49
5.6.150.0030.04018.21
5.6.140.0030.04018.25
5.6.130.0030.04718.19
5.6.120.0070.08321.00
5.6.110.0030.06320.98
5.6.100.0030.09720.89
5.6.90.0030.09021.01
5.6.80.0170.07320.38
5.6.70.3900.05320.50
5.5.350.0170.05020.43
5.5.340.0070.05018.09
5.5.330.0070.04020.19
5.5.320.0130.08020.38
5.5.310.0330.07020.47
5.5.300.0070.06318.07
5.5.290.0100.07717.92
5.5.280.0070.07020.85
5.5.270.0170.07320.82
5.5.260.0100.08720.77
5.5.250.0030.08320.62
5.5.240.0070.03720.24
5.4.450.0130.06019.48
5.4.440.0130.05719.18
5.4.430.0600.06719.63
5.4.420.0130.05319.52
5.4.410.0100.07318.98
5.4.400.0170.05318.91
5.4.390.0030.06018.80
5.4.380.0170.05318.50
5.4.370.0200.04718.58
5.4.360.0170.05318.63
5.4.350.0170.05318.79
5.4.340.0170.05018.76
5.4.320.0060.04112.50
5.4.310.0050.04012.50
5.4.300.0050.03812.50
5.4.290.0060.04412.50
5.4.280.0370.08312.38
5.4.270.0110.04712.37
5.4.260.0110.06112.37
5.4.250.0110.05212.37
5.4.240.0250.06712.37
5.4.230.0100.05012.37
5.4.220.0120.05912.36
5.4.210.0070.05412.36
5.4.200.0120.04912.37
5.4.190.0110.08112.36
5.4.180.0180.11212.36
5.4.170.0110.05212.37
5.4.160.0110.06512.37
5.4.150.0200.10812.36
5.4.140.0110.04512.04
5.4.130.0120.04612.04
5.4.120.0110.04711.99
5.4.110.0120.06911.98
5.4.100.0090.03411.98
5.4.90.0060.04011.98
5.4.80.0050.04011.98
5.4.70.0070.03611.98
5.4.60.0060.03711.98
5.4.50.0060.03811.98
5.4.40.0100.03711.97
5.4.30.0090.03711.96
5.4.20.0080.04111.97
5.4.10.0070.04011.96
5.4.00.0100.04711.45
5.3.290.0100.04212.80
5.3.280.0190.06112.71
5.3.270.0180.07812.73
5.3.260.0080.04012.72
5.3.250.0250.06612.72
5.3.240.0080.05712.72
5.3.230.0090.05512.71
5.3.220.0060.04212.68
5.3.210.0120.05912.68
5.3.200.0220.07012.68
5.3.190.0110.06812.68
5.3.180.0130.04412.67
5.3.170.0100.04112.67
5.3.160.0090.04012.68
5.3.150.0050.04312.67
5.3.140.0090.03712.66
5.3.130.0100.04612.66
5.3.120.0110.05012.66
5.3.110.0080.04712.66
5.3.100.0240.08812.11
5.3.90.0180.08112.08
5.3.80.0130.06312.08
5.3.70.0160.06212.07
5.3.60.0110.04012.07
5.3.50.0080.05212.00
5.3.40.0190.07212.00
5.3.30.0070.05611.95
5.3.20.0190.11511.74
5.3.10.0150.07111.70
5.3.00.0170.05311.70
5.2.170.0140.0549.19
5.2.160.0070.0319.19
5.2.150.0080.0309.19
5.2.140.0110.0509.18
5.2.130.0050.0329.14
5.2.120.0130.0479.14
5.2.110.0070.0389.15
5.2.100.0100.0529.14
5.2.90.0060.0389.14
5.2.80.0060.0439.14
5.2.70.0090.0379.14
5.2.60.0080.0419.10
5.2.50.0110.0569.08
5.2.40.0190.0569.04
5.2.30.0050.0449.02
5.2.20.0070.0389.00
5.2.10.0080.0378.92
5.2.00.0070.0508.79
5.1.60.0080.0528.07
5.1.50.0220.0568.07
5.1.40.0080.0408.05
5.1.30.0080.0378.39
5.1.20.0130.0508.43
5.1.10.0150.0788.15
5.1.00.0260.0608.14
5.0.50.0100.1056.63
5.0.40.0070.0356.50
5.0.30.0060.0426.30
5.0.20.0060.0216.27
5.0.10.0070.0266.25
5.0.00.0080.0416.25
4.4.90.0060.0164.77
4.4.80.0040.0244.75
4.4.70.0050.0184.75
4.4.60.0050.0184.75
4.4.50.0060.0174.77
4.4.40.0070.0264.71
4.4.30.0090.0164.76
4.4.20.0060.0184.84
4.4.10.0140.0464.85
4.4.00.0040.0334.76
4.3.110.0110.0194.67
4.3.100.0110.0264.67
4.3.90.0080.0244.64
4.3.80.0050.0384.58
4.3.70.0100.0204.63
4.3.60.0040.0284.63
4.3.50.0090.0404.63
4.3.40.0040.0344.54
4.3.30.0100.0553.31
4.3.20.0070.0183.29
4.3.10.0020.0243.25
4.3.00.0100.01313.64

preferences:
39.57 ms | 401 KiB | 5 Q