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); var_dump($lookFor); /*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]); } } //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.60.0120.00316.50
8.3.50.0110.01022.05
8.3.40.0060.00918.86
8.3.30.0140.00018.89
8.3.20.0080.00020.38
8.3.10.0080.00023.65
8.3.00.0070.00020.71
8.2.180.0160.00616.50
8.2.170.0140.00322.96
8.2.160.0180.00022.21
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00022.21
8.2.110.0070.00322.26
8.2.100.0040.00817.72
8.2.90.0050.00219.22
8.2.80.0030.00518.05
8.2.70.0000.00817.63
8.2.60.0000.00818.03
8.2.50.0000.00818.07
8.2.40.0080.00019.25
8.2.30.0000.00818.20
8.2.20.0000.00817.79
8.2.10.0000.00817.82
8.2.00.0000.00717.74
8.1.280.0170.00325.92
8.1.270.0000.00823.97
8.1.260.0080.00026.35
8.1.250.0040.01128.09
8.1.240.0060.00323.84
8.1.230.0040.00819.09
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0030.00617.35
8.1.190.0040.00417.41
8.1.180.0000.01018.10
8.1.170.0060.00318.65
8.1.160.0000.00721.89
8.1.150.0040.00418.61
8.1.140.0040.00417.37
8.1.130.0030.00317.82
8.1.120.0040.00317.45
8.1.110.0000.00717.38
8.1.100.0080.00017.50
8.1.90.0030.00617.39
8.1.80.0000.00817.44
8.1.70.0000.00717.35
8.1.60.0030.00517.57
8.1.50.0000.00717.57
8.1.40.0050.00217.41
8.1.30.0040.00417.66
8.1.20.0050.00317.68
8.1.10.0080.00017.57
8.1.00.0040.00417.54
8.0.300.0070.00018.77
8.0.290.0050.00317.04
8.0.280.0070.00018.48
8.0.270.0000.00817.18
8.0.260.0060.00016.88
8.0.250.0030.00316.94
8.0.240.0000.00716.98
8.0.230.0030.00316.98
8.0.220.0030.00316.90
8.0.210.0080.00016.94
8.0.200.0040.00416.83
8.0.190.0040.00316.98
8.0.180.0040.00416.90
8.0.170.0040.00416.93
8.0.160.0050.00216.87
8.0.150.0100.00016.85
8.0.140.0000.00816.88
8.0.130.0000.00713.32
8.0.120.0030.00516.84
8.0.110.0050.00316.85
8.0.100.0000.00716.79
8.0.90.0030.00316.92
8.0.80.0070.00716.87
8.0.70.0000.00816.74
8.0.60.0040.00416.94
8.0.50.0000.00716.85
8.0.30.0070.01217.05
8.0.20.0120.00717.40
8.0.10.0040.00416.90
8.0.00.0060.01116.78
7.4.330.0000.00515.07
7.4.320.0000.00616.48
7.4.300.0030.00316.58
7.4.290.0000.00716.53
7.4.280.0070.00016.51
7.4.270.0000.00616.48
7.4.260.0030.00616.40
7.4.250.0040.00416.50
7.4.240.0000.00816.56
7.4.230.0000.00716.51
7.4.220.0150.00916.67
7.4.210.0090.00716.60
7.4.200.0080.00016.35
7.4.190.0000.00716.69
7.4.160.0080.00816.56
7.4.150.0100.01017.40
7.4.140.0100.00817.86
7.4.130.0070.01216.58
7.4.120.0130.00316.51
7.4.110.0080.00816.41
7.4.100.0100.01016.48
7.4.90.0000.01616.30
7.4.80.0160.00016.64
7.4.70.0170.00016.50
7.4.60.0030.01316.45
7.4.50.0050.00316.61
7.4.40.0070.00722.77
7.4.30.0100.00716.40
7.4.00.0040.01115.17
7.3.330.0030.00313.24
7.3.320.0030.00313.44
7.3.310.0000.00616.18
7.3.300.0030.00316.32
7.3.290.0100.00716.38
7.3.280.0070.01316.37
7.3.270.0140.00517.40
7.3.260.0030.02116.56
7.3.250.0130.01016.35
7.3.240.0060.00916.25
7.3.230.0060.00916.42
7.3.210.0030.01316.46
7.3.200.0120.00619.39
7.3.190.0100.01416.32
7.3.180.0080.00816.51
7.3.170.0000.01516.51
7.3.160.0110.00516.47
7.3.120.0060.00914.63
7.2.330.0030.01316.93
7.2.320.0140.00316.85
7.2.310.0100.00616.84
7.2.300.0130.00316.75
7.2.290.0080.00816.65
7.2.00.0030.00919.46
7.1.100.0000.00918.29
7.1.70.0030.00617.17
7.1.60.0140.01019.29
7.1.50.0040.01816.70
7.1.00.0100.07022.36
7.0.200.0090.00316.80
7.0.140.0030.07322.10
7.0.60.0200.06019.87
7.0.50.0070.07317.73
7.0.40.0030.06020.11
7.0.30.0300.08020.23
7.0.20.0300.08320.33
7.0.10.0230.04720.12
7.0.00.0070.03720.05
5.6.280.0030.10020.91
5.6.210.0070.08020.55
5.6.200.0100.08318.14
5.6.190.0030.09020.50
5.6.180.0070.04020.52
5.6.170.0200.05320.67
5.6.160.0070.04020.57
5.6.150.0100.07318.25
5.6.140.0200.07318.15
5.6.130.0130.07318.18
5.6.120.0070.06320.90
5.6.110.0130.08321.03
5.6.100.0130.06021.15
5.6.90.0100.08321.11
5.6.80.0070.06720.51
5.6.70.0430.06320.50
5.5.350.0000.08720.46
5.5.340.0100.06017.98
5.5.330.0000.06020.41
5.5.320.0070.08020.27
5.5.310.0130.04320.27
5.5.300.0070.04718.08
5.5.290.0100.06317.99
5.5.280.0100.06320.88
5.5.270.0070.04020.77
5.5.260.0070.09020.80
5.5.250.0170.07020.80
5.5.240.0000.04020.36
5.4.450.1000.03719.49
5.4.440.0100.06719.61
5.4.430.0170.06019.15
5.4.420.0170.05719.34
5.4.410.0130.07318.69
5.4.400.0070.05718.51
5.4.390.0200.04318.75
5.4.380.0200.05018.76
5.4.370.0200.04718.72
5.4.360.0270.05318.70
5.4.350.0170.06018.64
5.4.340.0200.06018.73
5.4.320.0040.03812.51
5.4.310.0060.03812.50
5.4.300.0060.03712.51
5.4.290.0080.04612.50
5.4.280.0150.06112.37
5.4.270.0110.05812.37
5.4.260.0190.06512.37
5.4.250.0150.07012.37
5.4.240.0120.08112.37
5.4.230.0140.05812.36
5.4.220.0050.04312.36
5.4.210.0070.03912.36
5.4.200.0060.04212.36
5.4.190.0040.04112.36
5.4.180.0090.04312.36
5.4.170.0100.04012.36
5.4.160.0090.03912.36
5.4.150.0090.03712.36
5.4.140.0090.03912.04
5.4.130.0080.03812.03
5.4.120.0090.03711.99
5.4.110.0100.04911.98
5.4.100.0220.08711.98
5.4.90.0060.06211.99
5.4.80.0150.07111.98
5.4.70.0020.05811.98
5.4.60.0150.03011.98
5.4.50.0080.03811.98
5.4.40.0080.04111.96
5.4.30.0150.03311.97
5.4.20.0070.03611.96
5.4.10.0120.06111.97
5.4.00.0250.10411.46
5.3.290.0080.04012.80
5.3.280.0120.06112.71
5.3.270.0050.05112.72
5.3.260.0080.04312.72
5.3.250.0110.05212.71
5.3.240.0170.11312.72
5.3.230.0100.05612.71
5.3.220.0140.05112.68
5.3.210.0120.06012.68
5.3.200.0220.10912.68
5.3.190.0100.04812.68
5.3.180.0130.04112.67
5.3.170.0110.06812.67
5.3.160.0090.04212.67
5.3.150.0090.04512.67
5.3.140.0110.04712.66
5.3.130.0260.07512.65
5.3.120.0150.07412.66
5.3.110.0080.09612.66
5.3.100.0100.03712.11
5.3.90.0070.04112.08
5.3.80.0110.03512.07
5.3.70.0070.04012.07
5.3.60.0130.04812.06
5.3.50.0070.04312.00
5.3.40.0070.04112.00
5.3.30.0180.06211.95
5.3.20.0060.06611.75
5.3.10.0130.04911.70
5.3.00.0080.05511.70
5.2.170.0050.0459.19
5.2.160.0030.0389.19
5.2.150.0060.0399.19
5.2.140.0040.0439.19
5.2.130.0110.0489.14
5.2.120.0130.0639.14
5.2.110.0100.0469.15
5.2.100.0120.0559.14
5.2.90.0100.0299.14
5.2.80.0080.0349.15
5.2.70.0080.0489.14
5.2.60.0120.0639.09
5.2.50.0130.0669.07
5.2.40.0080.0409.04
5.2.30.0060.0469.02
5.2.20.0090.0939.01
5.2.10.0140.0698.92
5.2.00.0080.0528.79
5.1.60.0080.0528.07
5.1.50.0060.0428.07
5.1.40.0080.0428.05
5.1.30.0130.0558.40
5.1.20.0080.0398.42
5.1.10.0040.0408.14
5.1.00.0040.0428.15
5.0.50.0030.0296.62
5.0.40.0110.0556.48
5.0.30.0060.0616.30
5.0.20.0100.0416.27
5.0.10.0120.0456.25
5.0.00.0140.0576.23
4.4.90.0070.0374.78
4.4.80.0050.0294.75
4.4.70.0070.0154.76
4.4.60.0030.0264.75
4.4.50.0110.0334.77
4.4.40.0060.0444.71
4.4.30.0080.0294.76
4.4.20.0160.0424.84
4.4.10.0060.0484.85
4.4.00.0210.0554.75
4.3.110.0130.0364.66
4.3.100.0060.0354.67
4.3.90.0040.0264.63
4.3.80.0060.0354.58
4.3.70.0030.0284.63
4.3.60.0060.0204.63
4.3.50.0050.0224.63
4.3.40.0050.0334.54
4.3.30.0040.0223.29
4.3.20.0050.0223.28
4.3.10.0050.0243.23
4.3.00.0100.01713.64

preferences:
47.11 ms | 401 KiB | 5 Q