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) return; /*else if (count($searchPath) == 1) { $array = $newValue; }*/ $lookFor = array_shift($searchPath); /*if ($lookFor === null) { foreach ($array as &$value) { if (is_array($value)) deepReplace($searchPath, $newValue, $value); } }*/ else if (is_array($array) && array_key_exists($lookFor, $array)) { deepReplace($searchPath, $newValue, $array[$lookFor]); } var_dump($searchPath); } //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)
5.4.280.0230.05912.38
5.4.270.0150.07612.38
5.4.260.0110.04712.38
5.4.250.0180.05212.38
5.4.240.0060.04012.38
5.4.230.0060.04212.37
5.4.220.0100.03512.38
5.4.210.0030.04012.37
5.4.200.0060.04112.38
5.4.190.0050.04012.37
5.4.180.0060.04112.37
5.4.170.0100.03512.38
5.4.160.0050.04012.38
5.4.150.0110.04412.37
5.4.140.0050.04412.06
5.4.130.0290.09312.04
5.4.120.0120.09712.00
5.4.110.0120.08812.00
5.4.100.0190.08012.00
5.4.90.0200.06612.00
5.4.80.0200.07612.00
5.4.70.0170.07912.00
5.4.60.0150.06912.00
5.4.50.0180.08412.00
5.4.40.0110.04911.99
5.4.30.0070.05211.98
5.4.20.0120.04911.98
5.4.10.0140.06911.98
5.4.00.0060.06811.48
5.3.280.0150.10112.70
5.3.270.0110.09112.73
5.3.260.0110.05212.72
5.3.250.0180.06312.72
5.3.240.0130.07112.72
5.3.230.0160.05912.71
5.3.220.0040.04412.68
5.3.210.0090.05012.68
5.3.200.0120.04912.68
5.3.190.0070.04012.68
5.3.180.0080.03712.68
5.3.170.0090.03612.67
5.3.160.0080.04112.67
5.3.150.0080.04012.68
5.3.140.0220.05612.66
5.3.130.0040.04112.65
5.3.120.0050.04112.66
5.3.110.0090.03812.66
5.3.100.0040.04112.12
5.3.90.0050.04112.09
5.3.80.0070.04812.08
5.3.70.0080.04712.07
5.3.60.0090.04112.06
5.3.50.0100.10412.00
5.3.40.0160.08612.00
5.3.30.0090.06211.95
5.3.20.0210.08611.74
5.3.10.0110.06311.70
5.3.00.0070.05611.70
5.2.170.0080.0399.20
5.2.160.0110.0449.19
5.2.150.0080.0419.19
5.2.140.0050.0479.18
5.2.130.0130.0499.15
5.2.120.0070.0429.15
5.2.110.0040.0409.15
5.2.100.0080.0319.15
5.2.90.0060.0799.15
5.2.80.0120.0669.14
5.2.70.0100.0689.14
5.2.60.0050.0579.09
5.2.50.0090.0539.07
5.2.40.0090.0599.04
5.2.30.0190.0559.02
5.2.20.0060.0399.01
5.2.10.0090.0588.91
5.2.00.0090.0408.78
5.1.60.0060.0358.07
5.1.50.0130.0398.07
5.1.40.0090.0528.05
5.1.30.0100.0508.39
5.1.20.0050.0398.42
5.1.10.0110.0638.15
5.1.00.0150.0988.15
5.0.50.0140.0526.63
5.0.40.0150.0506.49
5.0.30.0040.0566.29
5.0.20.0080.0416.26
5.0.10.0060.0306.25
5.0.00.0060.0636.24
4.4.90.0060.0234.78
4.4.80.0080.0254.76
4.4.70.0030.0264.75
4.4.60.0050.0234.75
4.4.50.0040.0234.77
4.4.40.0070.0374.71
4.4.30.0030.0234.76
4.4.20.0060.0364.84
4.4.10.0050.0354.85
4.4.00.0060.0334.76
4.3.110.0080.0274.66
4.3.100.0080.0324.67
4.3.90.0040.0294.63
4.3.80.0050.0364.58
4.3.70.0050.0254.63
4.3.60.0140.0394.63
4.3.50.0160.0514.63
4.3.40.0040.0434.54
4.3.30.0040.0203.30
4.3.20.0030.0163.28
4.3.10.0000.0183.23
4.3.00.0170.01313.64

preferences:
134.79 ms | 1394 KiB | 7 Q