3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'a' => 'A', 'b' => 'B', 'c' => 'C'); var_dump($arr); // Taking "$val" as a reference here allows modifying the parent hashtable // directly, i.e. the $val ref "knows" its parent key in some sense foreach ($arr as &$val) { if ($val == 'B') { $val = 'X'; } } var_dump($arr); // However, it doesn't allow you to unset the parent key... foreach ($arr as &$val) { if ($val == 'B') { unset($val); } } var_dump($arr);

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.0150.00316.63
8.3.50.0080.01021.95
8.3.40.0120.00618.59
8.3.30.0130.00418.93
8.3.20.0040.00420.04
8.3.10.0070.00023.52
8.3.00.0040.00419.13
8.2.180.0080.00616.38
8.2.170.0040.01122.96
8.2.160.0130.00020.43
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0140.00426.16
8.2.120.0030.00522.24
8.2.110.0060.00322.29
8.2.100.0000.01017.72
8.2.90.0020.00519.09
8.2.80.0000.00818.03
8.2.70.0040.00417.61
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0000.00718.07
8.2.20.0000.00717.69
8.2.10.0000.00818.12
8.2.00.0070.00317.62
8.1.280.0030.01725.92
8.1.270.0040.00422.23
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.93
8.1.230.0110.00019.13
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0000.00917.48
8.1.190.0000.00817.63
8.1.180.0040.00418.10
8.1.170.0080.00018.71
8.1.160.0000.00722.01
8.1.150.0000.00718.63
8.1.140.0060.00317.50
8.1.130.0030.00317.70
8.1.120.0040.00417.46
8.1.110.0030.00517.38
8.1.100.0000.00717.51
8.1.90.0000.00717.46
8.1.80.0060.00317.45
8.1.70.0000.00717.37
8.1.60.0030.00517.46
8.1.50.0040.00417.39
8.1.40.0080.00017.52
8.1.30.0000.00817.46
8.1.20.0000.00817.58
8.1.10.0040.00417.34
8.1.00.0040.00417.27
8.0.300.0040.00418.77
8.0.290.0070.00017.05
8.0.280.0040.00418.55
8.0.270.0000.00817.30
8.0.260.0060.00017.16
8.0.250.0030.00316.95
8.0.240.0030.00317.02
8.0.230.0000.00716.84
8.0.220.0030.00316.91
8.0.210.0000.00716.86
8.0.200.0030.00316.96
8.0.190.0030.00316.82
8.0.180.0040.00416.86
8.0.170.0030.00516.95
8.0.160.0070.00016.88
8.0.150.0050.00316.80
8.0.140.0070.00016.72
8.0.130.0060.00013.35
8.0.120.0080.00016.86
8.0.110.0050.00316.82
8.0.100.0040.00416.94
8.0.90.0050.00216.93
8.0.80.0060.00916.95
8.0.70.0040.00416.78
8.0.60.0000.00716.74
8.0.50.0040.00416.95
8.0.30.0160.00417.12
8.0.20.0100.01217.40
8.0.10.0040.00416.84
8.0.00.0070.01016.84
7.4.330.0060.00015.00
7.4.320.0000.00716.63
7.4.300.0060.00016.61
7.4.290.0000.00716.53
7.4.280.0030.00716.38
7.4.270.0040.00416.57
7.4.260.0080.00016.48
7.4.250.0000.00816.37
7.4.240.0020.00516.54
7.4.230.0020.00516.63
7.4.220.0030.02016.55
7.4.210.0070.00816.59
7.4.200.0000.00716.53
7.4.190.0000.00716.38
7.4.160.0130.00316.55
7.4.150.0090.00917.40
7.4.140.0160.01517.86
7.4.130.0060.01716.48
7.4.120.0110.00616.41
7.4.110.0100.00716.54
7.4.100.0120.00616.36
7.4.90.0090.01016.50
7.4.80.0060.00919.39
7.4.70.0170.00016.60
7.4.60.0110.00616.46
7.4.50.0090.00016.38
7.4.40.0060.01022.77
7.4.30.0040.01216.64
7.4.00.0070.01014.53
7.3.330.0040.00313.20
7.3.320.0000.00513.00
7.3.310.0000.00716.29
7.3.300.0000.00716.17
7.3.290.0110.00316.21
7.3.280.0090.01016.28
7.3.270.0120.00617.40
7.3.260.0100.00716.38
7.3.250.0110.00616.26
7.3.240.0150.00616.18
7.3.230.0070.01016.39
7.3.210.0100.00716.44
7.3.200.0080.01319.39
7.3.190.0080.01216.63
7.3.180.0090.00916.22
7.3.170.0110.01116.50
7.3.160.0060.01216.36
7.3.120.0030.01314.59
7.2.330.0100.00716.64
7.2.320.0110.00716.42
7.2.310.0000.01616.66
7.2.300.0110.00816.46
7.2.290.0080.00816.68
7.2.60.0060.00916.85
7.2.00.0030.01219.53
7.1.200.0070.00715.78
7.1.100.0070.00718.27
7.1.70.0030.00516.81
7.1.60.0100.01319.33
7.1.50.0220.01334.66
7.1.00.0070.07322.45
7.0.200.0000.00716.59
7.0.140.0000.07721.97
7.0.60.0070.04019.93
7.0.50.0000.04317.88
7.0.40.0130.05019.96
7.0.30.0330.08020.13
7.0.20.0400.07020.13
7.0.10.0030.07020.30
7.0.00.0030.05320.17
5.6.280.0070.07020.82
5.6.210.0130.03720.72
5.6.200.0170.07318.11
5.6.190.0070.04320.61
5.6.180.0200.07020.32
5.6.170.0270.07020.71
5.6.160.0030.04020.49
5.6.150.0070.08018.18
5.6.140.0200.06318.20
5.6.130.0000.07718.11
5.6.120.0070.08721.03
5.6.110.0200.05720.98
5.6.100.0170.07320.95
5.6.90.0030.09020.98
5.6.80.0030.08020.43
5.5.350.0200.04020.52
5.5.340.0130.04717.98
5.5.330.0130.07320.40
5.5.320.0330.06720.41
5.5.310.0330.06320.29
5.5.300.0070.03717.89
5.5.290.0070.08017.98
5.5.280.0070.04320.76
5.5.270.0100.07720.77
5.5.260.0000.04320.67
5.5.250.0100.06320.46
5.5.240.0200.07020.35
5.4.450.0070.06019.41
5.4.440.0070.05319.50
5.4.430.0070.04719.46
5.4.420.0030.06019.11
5.4.410.0000.05319.28
5.4.400.0100.07018.91
5.4.390.0130.07019.16
5.4.380.0030.08319.08
5.4.370.0030.04318.92
5.4.360.0030.05318.91
5.4.350.0030.05018.81
5.4.340.0070.05719.12
5.4.320.0100.04018.77
5.4.310.0100.05719.14
5.4.300.0000.08319.17
5.4.290.0070.04018.78
5.4.280.0130.06319.07
5.4.270.0070.04719.19
5.4.260.0030.04019.15
5.4.250.0070.04719.11
5.4.240.0100.07018.95
5.4.230.0030.07718.99
5.4.220.0130.05319.14
5.4.210.0100.07319.13
5.4.200.0100.05718.91
5.4.190.0100.07319.16
5.4.180.0070.03718.78
5.4.170.0030.04018.93
5.4.160.0100.04719.10
5.4.150.0070.08019.18
5.4.140.0030.08016.17
5.4.130.0100.07016.35
5.4.120.0030.04316.43
5.4.110.0030.05016.39
5.4.100.0070.07316.24
5.4.90.0030.06316.61
5.4.80.0100.07316.22
5.4.70.0070.04716.14
5.4.60.0030.08016.34
5.4.50.0070.07716.20
5.4.40.0170.05716.20
5.4.30.0130.05316.36
5.4.20.0030.04316.28
5.4.10.0030.04016.35
5.4.00.0030.03715.82
5.3.290.0070.03714.64
5.3.280.0070.07714.49
5.3.270.0100.03314.54
5.3.260.0070.05014.69
5.3.250.0130.06714.62
5.3.240.0070.06014.43
5.3.230.0000.07714.52
5.3.220.0000.04014.49
5.3.210.0000.07714.44
5.3.200.0030.06714.50
5.3.190.0200.06714.50
5.3.180.0070.05714.51
5.3.170.0100.06714.52
5.3.160.0030.04714.50
5.3.150.0030.04014.48
5.3.140.0100.07014.53
5.3.130.0030.06014.47
5.3.120.0000.08014.46
5.3.110.0100.05014.48
5.3.100.0070.07313.82
5.3.90.0070.07013.95
5.3.80.0100.07313.85
5.3.70.0170.06013.95
5.3.60.0000.04313.94
5.3.50.0030.07013.91
5.3.40.0030.05713.73
5.3.30.0100.04013.93
5.3.20.0100.03013.62
5.3.10.0030.06313.58
5.3.00.0070.04713.47
5.2.170.0030.05011.05
5.2.160.0100.05711.15
5.2.150.0000.03711.08
5.2.140.0030.03711.13
5.2.130.0000.05711.08
5.2.120.0100.05711.00
5.2.110.0070.06011.04
5.2.100.0070.05711.09
5.2.90.0030.05711.07
5.2.80.0030.04011.02
5.2.70.0070.06010.98
5.2.60.0070.04711.04
5.2.50.0000.06710.90
5.2.40.0000.04310.96
5.2.30.0030.05710.93
5.2.20.0200.02011.11
5.2.10.0030.06311.01
5.2.00.0070.05710.57
5.1.60.0030.0309.98
5.1.50.0000.04010.05
5.1.40.0030.0409.99
5.1.30.0070.05310.33
5.1.20.0100.05010.20
5.1.10.0000.06310.02
5.1.00.0070.05010.04
5.0.50.0100.0238.49
5.0.40.0130.0308.37
5.0.30.0070.0578.28
5.0.20.0070.0238.25
5.0.10.0070.0308.13
5.0.00.0000.0478.17
4.4.90.0030.0237.57
4.4.80.0030.0377.57
4.4.70.0000.0307.57
4.4.60.0000.0207.57
4.4.50.0130.0237.57
4.4.40.0030.0537.57
4.4.30.0000.0407.57
4.4.20.0030.0337.57
4.4.10.0000.0307.57
4.4.00.0030.0537.57
4.3.110.0000.0337.57
4.3.100.0000.0337.57
4.3.90.0000.0207.57
4.3.80.0100.0377.57
4.3.70.0070.0177.57
4.3.60.0000.0337.57
4.3.50.0000.0277.57
4.3.40.0070.0407.57
4.3.30.0000.0237.57
4.3.20.0000.0237.57
4.3.10.0000.0177.57
4.3.00.0030.0137.57

preferences:
40.01 ms | 400 KiB | 5 Q