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)
8.3.60.0040.01118.31
8.3.50.0120.00522.05
8.3.40.0130.00718.59
8.3.30.0150.00018.95
8.3.20.0040.00420.02
8.3.10.0040.00423.65
8.3.00.0070.00020.58
8.2.180.0080.01216.63
8.2.170.0110.00422.96
8.2.160.0070.01022.26
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00322.21
8.2.110.0070.00322.27
8.2.100.0100.00317.78
8.2.90.0000.00817.63
8.2.80.0050.00317.97
8.2.70.0060.00317.93
8.2.60.0040.00417.90
8.2.50.0000.00718.10
8.2.40.0020.00520.41
8.2.30.0080.00018.05
8.2.20.0000.00717.54
8.2.10.0030.00517.58
8.2.00.0070.00017.56
8.1.280.0110.00425.92
8.1.270.0080.00022.18
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0130.00020.67
8.1.230.0120.00019.05
8.1.220.0030.00617.78
8.1.210.0040.00418.77
8.1.200.0060.00317.13
8.1.190.0060.00317.23
8.1.180.0090.00018.10
8.1.170.0000.00918.52
8.1.160.0000.00721.92
8.1.150.0040.00418.66
8.1.140.0070.00017.45
8.1.130.0070.00017.70
8.1.120.0000.00717.47
8.1.110.0080.00017.34
8.1.100.0030.00317.50
8.1.90.0050.00217.45
8.1.80.0030.00317.35
8.1.70.0000.00717.38
8.1.60.0080.00417.59
8.1.50.0080.00017.50
8.1.40.0040.00417.42
8.1.30.0040.00417.59
8.1.20.0000.00817.63
8.1.10.0040.00417.47
8.1.00.0030.00617.44
8.0.300.0030.00519.66
8.0.290.0000.00716.63
8.0.280.0030.00318.40
8.0.270.0070.00017.15
8.0.260.0030.00316.78
8.0.250.0000.00716.93
8.0.240.0040.00416.82
8.0.230.0000.00716.92
8.0.220.0000.00716.82
8.0.210.0030.00316.83
8.0.200.0030.00316.78
8.0.190.0040.00416.93
8.0.180.0000.00816.84
8.0.170.0040.00416.80
8.0.160.0040.00416.91
8.0.150.0000.00816.86
8.0.140.0000.00716.93
8.0.130.0050.00013.32
8.0.120.0040.00416.76
8.0.110.0030.00516.91
8.0.100.0040.00417.00
8.0.90.0000.00716.86
8.0.80.0120.00316.86
8.0.70.0000.00716.95
8.0.60.0040.00416.78
8.0.50.0040.00416.91
8.0.30.0080.01316.80
8.0.20.0100.01117.40
8.0.10.0000.00716.90
8.0.00.0080.01116.69
7.4.330.0020.00215.15
7.4.320.0030.00316.46
7.4.300.0000.00616.45
7.4.290.0000.00716.57
7.4.280.0040.00416.59
7.4.270.0020.00516.55
7.4.260.0000.00816.51
7.4.250.0050.00316.46
7.4.240.0020.00516.46
7.4.230.0070.00016.60
7.4.220.0070.01116.54
7.4.210.0070.00716.56
7.4.200.0000.00716.57
7.4.190.0070.00016.41
7.4.160.0080.00816.36
7.4.150.0080.01017.40
7.4.140.0090.01117.86
7.4.130.0050.01316.52
7.4.120.0110.00916.40
7.4.110.0090.00916.35
7.4.100.0070.01416.43
7.4.90.0060.01016.57
7.4.80.0120.00616.48
7.4.70.0040.01216.51
7.4.60.0080.00816.36
7.4.50.0050.00016.48
7.4.40.0090.00622.77
7.4.30.0060.01216.34
7.4.00.0030.01214.84
7.3.330.0030.00313.29
7.3.320.0030.00313.18
7.3.310.0030.00316.34
7.3.300.0070.00016.26
7.3.290.0140.00016.27
7.3.280.0040.01516.36
7.3.270.0000.01617.40
7.3.260.0150.00916.47
7.3.250.0120.00916.34
7.3.240.0120.00316.55
7.3.230.0100.00616.46
7.3.210.0110.00716.45
7.3.200.0150.00619.39
7.3.190.0100.00816.37
7.3.180.0100.00716.61
7.3.170.0060.00916.36
7.3.160.0000.01516.25
7.3.120.0040.00815.01
7.2.330.0100.00816.75
7.2.320.0070.01116.62
7.2.310.0100.01316.81
7.2.300.0170.00716.69
7.2.290.0040.01216.25
7.2.110.0180.00616.43
7.2.60.0070.00716.95
7.2.00.0030.01519.29
7.1.200.0250.00315.29
7.1.100.0080.00317.92
7.1.70.0030.00717.23
7.1.60.0100.01419.29
7.1.50.0030.01916.63
7.1.00.0070.07322.33
7.0.200.0130.00316.73
7.0.140.0100.06721.95
7.0.60.0030.07019.95
7.0.50.0030.04717.88
7.0.40.0030.09320.04
7.0.30.0270.07320.13
7.0.20.0300.06720.19
7.0.10.0000.05020.24
7.0.00.0030.08720.33
5.6.280.0100.06721.13
5.6.210.0170.05720.56
5.6.200.0030.08018.19
5.6.190.0130.06020.41
5.6.180.0270.04720.47
5.6.170.0200.05020.49
5.6.160.0030.08720.52
5.6.150.0100.05718.18
5.6.140.0030.07018.18
5.6.130.0100.08318.22
5.6.120.0030.07320.89
5.6.110.0000.06321.02
5.6.100.0100.05320.96
5.6.90.0070.04721.01
5.6.80.0130.07720.45
5.5.350.4100.04020.38
5.5.340.0000.08717.98
5.5.330.0070.05320.57
5.5.320.0270.04320.42
5.5.310.0400.05020.24
5.5.300.0030.08718.03
5.5.290.0000.04318.03
5.5.280.0030.04320.89
5.5.270.0030.06320.87
5.5.260.0200.07020.68
5.5.250.0030.08320.49
5.5.240.0200.07320.27
5.4.450.3970.03719.27
5.4.440.3800.03319.42
5.4.430.4070.03719.17
5.4.420.4200.03719.30
5.4.410.4270.04019.14
5.4.400.3570.03718.95
5.4.390.3800.04019.23
5.4.380.3900.04019.31
5.4.370.4570.03719.19
5.4.360.3470.03319.24
5.4.350.3700.03319.15
5.4.340.3630.04319.00
5.4.320.4000.03719.22
5.4.310.4070.03719.16
5.4.300.3330.04019.14
5.4.290.3430.03019.08
5.4.280.2930.04318.98
5.4.270.3400.03318.89
5.4.260.3370.03319.23
5.4.250.3900.04319.14
5.4.240.2870.03318.84
5.4.230.3730.03318.86
5.4.220.3630.03718.97
5.4.210.3430.03719.18
5.4.200.3970.03718.85
5.4.190.3430.03019.07
5.4.180.4270.03319.05
5.4.170.4530.03019.16
5.4.160.3770.03718.96
5.4.150.4400.03318.93
5.4.140.4370.03016.38
5.4.130.4070.03716.49
5.4.120.4170.02716.29
5.4.110.3200.03716.55
5.4.100.3600.04016.58
5.4.90.3530.03016.19
5.4.80.3470.03316.44
5.4.70.3500.03716.43
5.4.60.3300.03316.22
5.4.50.3770.03316.43
5.4.40.3630.03316.42
5.4.30.3470.03316.23
5.4.20.3170.03016.51
5.4.10.3230.03016.24
5.4.00.3200.03715.79
5.3.290.4170.04314.59
5.3.280.3330.04014.51
5.3.270.3830.04314.52
5.3.260.4230.04014.61
5.3.250.4330.03314.52
5.3.240.4200.04314.53
5.3.230.4330.03714.62
5.3.220.3270.03314.57
5.3.210.3570.04014.65
5.3.200.3530.02714.73
5.3.190.3230.03314.48
5.3.180.3370.04014.56
5.3.170.3300.04014.48
5.3.160.3570.03314.78
5.3.150.3730.03714.56
5.3.140.3600.03014.46
5.3.130.3470.05014.68
5.3.120.3170.04014.52
5.3.110.3070.04314.46
5.3.100.3530.03014.25
5.3.90.3230.03713.98
5.3.80.3670.04013.94
5.3.70.3670.03714.02
5.3.60.4030.03314.12
5.3.50.3730.03313.96
5.3.40.4270.04013.86
5.3.30.3900.03713.82
5.3.20.3470.03313.70
5.3.10.3570.03713.57
5.3.00.3170.03313.80
5.2.170.3230.03311.05
5.2.160.2930.03011.37
5.2.150.3370.03311.26
5.2.140.2930.03711.04
5.2.130.2970.03311.15
5.2.120.3000.03311.11
5.2.110.3070.02711.00
5.2.100.3130.03011.03
5.2.90.3670.03711.06
5.2.80.2900.03011.19
5.2.70.3430.03011.18
5.2.60.3500.03011.13
5.2.50.3370.02710.99
5.2.40.2930.03010.91
5.2.30.2400.03010.98
5.2.20.2970.02311.00
5.2.10.2400.02710.85
5.2.00.2270.03010.64
5.1.60.2200.0239.98
5.1.50.2430.02310.05
5.1.40.2170.0279.92
5.1.30.2400.02010.42
5.1.20.2370.03010.26
5.1.10.2100.02310.16
5.1.00.2230.02710.05
5.0.50.1670.0238.94
5.0.40.1570.0208.94
5.0.30.1600.0308.94
5.0.20.1630.0238.94
5.0.10.1430.0178.94
5.0.00.1400.0308.94
4.4.90.1330.0178.94
4.4.80.1600.0178.94
4.4.70.1470.0178.94
4.4.60.1430.0178.94
4.4.50.1300.0178.94
4.4.40.1500.0178.94
4.4.30.1500.0178.94
4.4.20.1070.0178.94
4.4.10.1330.0178.94
4.4.00.1530.0308.94
4.3.110.1730.0138.94
4.3.100.1670.0208.94
4.3.90.1430.0138.94
4.3.80.1200.0278.94
4.3.70.1330.0178.94
4.3.60.1370.0178.94
4.3.50.0900.0138.94
4.3.40.1270.0278.94
4.3.30.0800.0208.94
4.3.20.0770.0208.94
4.3.10.0900.0238.94
4.3.00.0930.0178.94

preferences:
35.44 ms | 401 KiB | 5 Q