3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array (1=>1, 2=> 2, 3 => array(1=>11, 2=>12, 3=>13)); $text = "test"; function modarr($array, $text) { foreach ($array as $key => $arr) { if(is_array($arr)) $res[$key] = modarr(&$arr,$text); // modification function here else $res[$key] = $arr.$text; } return $res; } $erg = modarr($array, $text); print_r($erg);

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.380.0330.04718.51
5.4.370.0300.04718.77
5.4.360.0300.05018.54
5.4.350.0270.06718.84
5.4.340.0300.04718.51
5.4.320.0300.05018.47
5.4.310.0230.05318.73
5.4.300.0270.05018.63
5.4.290.0230.05318.76
5.4.280.0330.05318.69
5.4.270.0200.06018.50
5.4.260.0170.06018.62
5.4.250.0170.07018.77
5.4.240.0230.05718.75
5.4.230.0230.05718.75
5.4.220.0230.05318.74
5.4.210.0200.05718.74
5.4.200.0230.06016.63
5.4.190.0230.05018.45
5.4.180.0270.05018.71
5.4.170.0130.07018.55
5.4.160.0170.05718.75
5.4.150.0270.05018.60
5.4.140.0170.05716.28
5.4.130.0270.04316.27
5.4.120.0330.06016.45
5.4.110.0270.04316.29
5.4.100.0230.05016.32
5.4.90.0230.05316.17
5.4.80.0270.04716.20
5.4.70.0230.05316.29
5.4.60.0200.05016.19
5.4.50.0300.04716.19
5.4.40.0330.04716.19
5.4.30.0270.05016.16
5.4.20.0170.05716.14
5.4.10.0200.05316.25
5.4.00.0200.05015.64
5.3.290.0230.07714.83
5.3.280.0370.05714.62
5.3.270.0130.06314.79
5.3.260.0370.04014.63
5.3.250.0300.04314.78
5.3.240.0200.05314.83
5.3.230.0170.05714.69
5.3.220.0300.04314.62
5.3.210.0230.05314.55
5.3.200.0270.05714.64
5.3.190.0200.07014.67
5.3.180.0200.05714.73
5.3.170.0330.06314.60
5.3.160.0400.06014.74
5.3.150.0230.05314.55
5.3.140.0300.05014.61
5.3.130.0230.06014.61
5.3.120.0100.06714.57
5.3.110.0170.06314.65
5.3.100.0330.04314.24
5.3.90.0200.06014.14
5.3.80.0330.05714.14
5.3.70.0300.05314.12
5.3.60.0430.05014.08
5.3.50.0330.06714.18
5.3.40.0470.05013.94
5.3.30.0270.05014.13
5.3.20.0230.05713.90
5.3.10.0270.05013.66
5.3.00.0300.05013.71
5.2.170.0270.03311.14
5.2.160.0200.04011.27
5.2.150.0170.04711.15
5.2.140.0170.05011.25
5.2.130.0370.04311.16
5.2.120.0300.03311.12
5.2.110.0200.04311.17
5.2.100.0200.04011.15
5.2.90.0170.04311.23
5.2.80.0130.05011.11
5.2.70.0270.03711.12
5.2.60.0130.04311.09
5.2.50.0200.04011.06
5.2.40.0130.04011.07
5.2.30.0170.04011.17
5.2.20.0170.03711.14
5.2.10.0200.05311.07
5.2.00.0200.03710.89
5.1.60.0200.03310.12
5.1.50.0200.03010.08
5.1.40.0170.0379.98
5.1.30.0130.03710.38
5.1.20.0200.03310.41
5.1.10.0130.04310.06
5.1.00.0230.04310.10
5.0.50.0100.0308.59
5.0.40.0100.0278.45
5.0.30.0070.0478.36
5.0.20.0100.0338.40
5.0.10.0130.0238.26
5.0.00.0100.0438.15
4.4.90.0070.0237.20
4.4.80.0100.0207.20
4.4.70.0100.0277.20
4.4.60.0030.0277.20
4.4.50.0070.0237.20
4.4.40.0100.0337.20
4.4.30.0030.0237.20
4.4.20.0070.0237.20
4.4.10.0100.0207.20
4.4.00.0100.0377.20
4.3.110.0100.0207.20
4.3.100.0100.0277.20
4.3.90.0030.0337.20
4.3.80.0130.0377.20
4.3.70.0100.0277.20
4.3.60.0030.0237.20
4.3.50.0070.0237.20
4.3.40.0170.0337.20
4.3.30.0070.0207.20
4.3.20.0070.0277.20
4.3.10.0030.0237.20
4.3.00.0100.0237.56

preferences:
147.03 ms | 1394 KiB | 7 Q