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) { var_dump($searchpath); 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.0120.00318.43
8.3.50.0080.00922.00
8.3.40.0090.00918.79
8.3.30.0120.00319.22
8.3.20.0070.00020.29
8.3.10.0030.00523.84
8.3.00.0000.00720.73
8.2.180.0130.00318.29
8.2.170.0140.00322.96
8.2.160.0140.00022.03
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.21
8.2.110.0060.00322.25
8.2.100.0070.00718.03
8.2.90.0000.00819.30
8.2.80.0000.00917.97
8.2.70.0050.00517.63
8.2.60.0080.00017.93
8.2.50.0000.00818.07
8.2.40.0000.00819.45
8.2.30.0040.00418.17
8.2.20.0000.00817.80
8.2.10.0040.00417.88
8.2.00.0000.00817.81
8.1.280.0120.00325.92
8.1.270.0080.00022.19
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0000.00823.91
8.1.230.0130.00319.12
8.1.220.0060.00317.78
8.1.210.0030.00618.77
8.1.200.0040.00417.23
8.1.190.0060.00317.42
8.1.180.0040.00418.10
8.1.170.0000.00918.71
8.1.160.0040.00422.03
8.1.150.0040.00418.64
8.1.140.0020.00517.38
8.1.130.0050.00317.76
8.1.120.0050.00317.55
8.1.110.0000.00717.41
8.1.100.0040.00417.49
8.1.90.0090.00017.46
8.1.80.0000.00717.52
8.1.70.0020.00517.27
8.1.60.0040.00417.57
8.1.50.0050.00517.44
8.1.40.0000.00817.47
8.1.30.0080.00017.61
8.1.20.0040.00417.58
8.1.10.0070.00017.59
8.1.00.0060.00317.51
8.0.300.0030.00518.77
8.0.290.0000.00717.05
8.0.280.0030.00318.52
8.0.270.0040.00417.32
8.0.260.0060.00316.81
8.0.250.0060.00017.04
8.0.240.0070.00017.00
8.0.230.0030.00316.91
8.0.220.0000.00716.96
8.0.210.0030.00316.99
8.0.200.0050.00216.92
8.0.190.0030.00517.03
8.0.180.0050.00317.00
8.0.170.0000.00816.95
8.0.160.0000.00816.93
8.0.150.0070.00016.93
8.0.140.0040.00416.83
8.0.130.0050.00013.42
8.0.120.0080.00016.97
8.0.110.0060.00316.86
8.0.100.0040.00416.87
8.0.90.0050.00316.79
8.0.80.0070.01016.92
8.0.70.0000.00716.84
8.0.60.0080.00016.83
8.0.50.0000.00716.94
8.0.30.0090.01017.27
8.0.20.0070.01117.40
8.0.10.0030.00317.10
8.0.00.0110.00716.71
7.4.330.0030.00315.00
7.4.320.0000.00716.57
7.4.300.0000.00716.62
7.4.290.0080.00016.63
7.4.280.0000.00716.63
7.4.270.0080.00016.51
7.4.260.0040.00316.59
7.4.250.0070.00016.38
7.4.240.0020.00516.43
7.4.230.0000.00816.69
7.4.220.0090.00916.57
7.4.210.0080.00816.54
7.4.200.0040.00416.64
7.4.190.0070.00016.42
7.4.160.0140.00316.38
7.4.150.0150.00317.40
7.4.140.0100.01417.86
7.4.130.0180.01716.47
7.4.120.0090.01216.57
7.4.110.0030.01416.49
7.4.100.0100.00916.67
7.4.90.0030.01316.54
7.4.80.0090.01216.54
7.4.70.0090.00816.52
7.4.60.0140.01116.77
7.4.50.0000.00916.57
7.4.40.0130.00322.77
7.4.30.0080.00816.56
7.4.00.0110.00714.97
7.3.330.0050.00013.46
7.3.320.0060.00013.34
7.3.310.0030.00316.32
7.3.300.0000.00716.30
7.3.290.0100.00316.46
7.3.280.0090.00816.43
7.3.270.0100.00717.40
7.3.260.0150.00616.74
7.3.250.0100.00816.49
7.3.240.0100.00716.40
7.3.230.0100.00716.48
7.3.210.0040.01216.47
7.3.200.0030.01619.39
7.3.190.0160.00616.37
7.3.180.0070.00716.48
7.3.170.0070.01016.58
7.3.160.0100.00716.61
7.3.120.0070.00714.76
7.2.330.0060.01516.82
7.2.320.0130.00416.60
7.2.310.0030.01416.62
7.2.300.0090.01516.39
7.2.290.0060.01016.89
7.2.00.0070.00719.32
7.1.200.0100.00315.80
7.1.100.0000.01117.77
7.1.70.0020.00516.91
7.1.60.0070.01719.29
7.1.50.0100.01617.03
7.1.00.0030.07022.43
7.0.200.0070.00416.82
7.0.140.0030.09322.00
7.0.60.0070.05019.83
7.0.50.0030.08317.91
7.0.40.0070.04020.40
7.0.30.0500.02720.17
7.0.20.0170.04320.08
7.0.10.0030.04720.30
7.0.00.0000.04720.05
5.6.280.0100.07021.07
5.6.210.0030.06720.67
5.6.200.0100.08318.25
5.6.190.0070.05720.77
5.6.180.0230.05320.63
5.6.170.0300.08020.52
5.6.160.0030.04020.61
5.6.150.0130.06718.15
5.6.140.0070.03718.15
5.6.130.0000.08718.13
5.6.120.0070.07021.09
5.6.110.0030.07321.15
5.6.100.0100.06721.11
5.6.90.0000.06721.13
5.6.80.0070.05320.54
5.5.350.0200.08020.36
5.5.340.0070.05317.98
5.5.330.0100.03320.37
5.5.320.0200.04720.27
5.5.310.0200.09320.32
5.5.300.0030.08717.98
5.5.290.0070.08017.98
5.5.280.0070.05020.97
5.5.270.0100.08020.75
5.5.260.0100.04020.75
5.5.250.0070.05020.59
5.5.240.0070.07320.17
5.4.450.0600.05319.34
5.4.440.0170.06019.58
5.4.430.0130.07319.46
5.4.420.0200.06719.51
5.4.410.0230.04319.32
5.4.400.0130.05319.38
5.4.390.0100.05319.21
5.4.380.0100.05319.27
5.4.370.0430.06018.48
5.4.360.0530.04718.77
5.4.350.0570.05718.47
5.4.340.0400.06718.53
5.4.320.0040.04112.50
5.4.310.0040.04512.50
5.4.300.0120.03812.50
5.4.290.0080.03612.50
5.4.280.0130.05112.37
5.4.270.0130.05412.37
5.4.260.0100.05812.37
5.4.250.0110.06912.37
5.4.240.0190.06312.37
5.4.230.0150.06712.36
5.4.220.0160.06912.36
5.4.210.0170.07412.36
5.4.200.0240.08812.36
5.4.190.0330.10912.36
5.4.180.0120.06912.36
5.4.170.0240.06112.37
5.4.160.0140.06712.36
5.4.150.0180.05912.36
5.4.140.0100.11012.04
5.4.130.0190.05812.03
5.4.120.0100.06311.99
5.4.110.0150.06211.98
5.4.100.0120.05311.98
5.4.90.0110.06511.99
5.4.80.0120.06011.99
5.4.70.0140.04211.98
5.4.60.0090.05211.98
5.4.50.0130.05911.98
5.4.40.0080.05911.97
5.4.30.0540.17611.97
5.4.20.0080.03611.96
5.4.10.0220.06511.96
5.4.00.0190.09611.45
5.3.290.0100.04612.80
5.3.280.0120.07212.70
5.3.270.0190.08812.72
5.3.260.0160.05412.72
5.3.250.0190.09412.71
5.3.240.0220.10312.72
5.3.230.0140.05912.71
5.3.220.0150.06212.68
5.3.210.0130.06612.68
5.3.200.0160.06212.68
5.3.190.0220.05712.67
5.3.180.0140.06112.68
5.3.170.0170.05712.67
5.3.160.0120.05812.67
5.3.150.0190.05712.68
5.3.140.0120.06412.66
5.3.130.0130.06112.66
5.3.120.0130.05512.66
5.3.110.0120.05412.66
5.3.100.0130.06012.12
5.3.90.0160.05712.09
5.3.80.0200.05512.08
5.3.70.0150.05412.08
5.3.60.0130.05512.06
5.3.50.0080.05812.00
5.3.40.0120.07012.00
5.3.30.0170.06111.95
5.3.20.0150.05811.75
5.3.10.0190.05811.70
5.3.00.0160.05711.70
5.2.170.0070.0599.19
5.2.160.0120.0479.19
5.2.150.0100.0439.19
5.2.140.0130.0429.18
5.2.130.0140.0579.14
5.2.120.0110.0399.15
5.2.110.0090.0419.15
5.2.100.0090.0439.16
5.2.90.0090.0469.15
5.2.80.0100.0459.15
5.2.70.0170.0779.14
5.2.60.0150.0559.09
5.2.50.0120.0449.08
5.2.40.0090.0389.04
5.2.30.0130.0619.02
5.2.20.0120.0479.00
5.2.10.0060.0458.92
5.2.00.0110.0428.79
5.1.60.0100.0348.07
5.1.50.0110.0318.07
5.1.40.0110.0338.05
5.1.30.0100.0358.40
5.1.20.0110.0388.42
5.1.10.0110.0368.15
5.1.00.0130.0368.14
5.0.50.0100.0316.64
5.0.40.0090.0326.50
5.0.30.0040.0446.31
5.0.20.0080.0276.27
5.0.10.0090.0276.25
5.0.00.0100.0396.24
4.4.90.0210.0444.78
4.4.80.0150.0374.75
4.4.70.0090.0294.75
4.4.60.0060.0244.75
4.4.50.0090.0374.77
4.4.40.0070.0544.71
4.4.30.0190.0504.76
4.4.20.0210.0464.84
4.4.10.0200.0404.85
4.4.00.0030.0374.76
4.3.110.0090.0274.67
4.3.100.0060.0174.66
4.3.90.0090.0224.64
4.3.80.0030.0394.59
4.3.70.0100.0384.63
4.3.60.0030.0224.63
4.3.50.0140.0354.62
4.3.40.0140.1154.53
4.3.30.0080.0263.31
4.3.20.0130.0523.29
4.3.10.0090.0403.25
4.3.00.0100.0237.54

preferences:
45.49 ms | 401 KiB | 5 Q