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($arr[2]); } } 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.40.0150.00018.60
8.3.30.0070.00718.92
8.3.20.0080.00020.25
8.3.10.0000.00823.61
8.3.00.0050.00319.13
8.2.170.0120.00322.96
8.2.160.0100.00720.52
8.2.150.0120.00624.18
8.2.140.0070.01024.66
8.2.130.0120.00826.16
8.2.120.0040.00422.07
8.2.110.0080.00022.08
8.2.100.0100.00317.91
8.2.90.0000.00819.23
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0060.00318.04
8.2.20.0040.00417.59
8.2.10.0080.00018.05
8.2.00.0030.00617.66
8.1.270.0090.00023.92
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0040.00423.86
8.1.230.0080.00418.80
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0030.00517.66
8.1.180.0000.00818.10
8.1.170.0050.00318.64
8.1.160.0000.00721.98
8.1.150.0000.00818.69
8.1.140.0080.00017.40
8.1.130.0000.00717.84
8.1.120.0000.00717.50
8.1.110.0040.00417.48
8.1.100.0000.00717.50
8.1.90.0040.00417.36
8.1.80.0030.00517.51
8.1.70.0030.00317.39
8.1.60.0030.00617.51
8.1.50.0040.00417.50
8.1.40.0000.00717.51
8.1.30.0000.00817.57
8.1.20.0060.00317.63
8.1.10.0050.00217.43
8.1.00.0050.00217.28
8.0.300.0070.00018.77
8.0.290.0040.00417.18
8.0.280.0080.00018.31
8.0.270.0030.00317.18
8.0.260.0000.00716.80
8.0.250.0000.00716.94
8.0.240.0030.00316.93
8.0.230.0040.00516.93
8.0.220.0030.00316.86
8.0.210.0030.00316.78
8.0.200.0000.01016.96
8.0.190.0040.00416.95
8.0.180.0070.00016.79
8.0.170.0040.00416.96
8.0.160.0000.00816.95
8.0.150.0000.00816.83
8.0.140.0000.01116.86
8.0.130.0030.00313.29
8.0.120.0000.00816.83
8.0.110.0000.00716.89
8.0.100.0090.00016.86
8.0.90.0040.00416.68
8.0.80.0100.01316.93
8.0.70.0030.00516.71
8.0.60.0000.00816.88
8.0.50.0040.00416.93
8.0.30.0060.01317.19
8.0.20.0140.00617.40
8.0.10.0030.00516.86
8.0.00.0170.00416.83
7.4.330.0000.00615.13
7.4.320.0030.00316.53
7.4.300.0000.00616.51
7.4.290.0070.00016.59
7.4.280.0040.00416.50
7.4.270.0000.00616.57
7.4.260.0040.00416.59
7.4.250.0040.00416.48
7.4.240.0030.00316.45
7.4.230.0030.00316.66
7.4.220.0030.01516.61
7.4.210.0110.00616.57
7.4.200.0070.00016.50
7.4.190.0000.00816.31
7.4.160.0050.01016.38
7.4.150.0150.00917.40
7.4.140.0090.00917.86
7.4.130.0100.01116.48
7.4.120.0120.01116.53
7.4.110.0090.00916.37
7.4.100.0190.00516.43
7.4.90.0080.01116.48
7.4.80.0100.01319.39
7.4.70.0130.00616.49
7.4.60.0060.01216.53
7.4.50.0000.00816.45
7.4.40.0020.00922.77
7.4.30.0180.00616.58
7.4.00.0100.00715.05
7.3.330.0030.00313.07
7.3.320.0030.00312.98
7.3.310.0000.00716.09
7.3.300.0070.00016.33
7.3.290.0210.00016.34
7.3.280.0080.00816.28
7.3.270.0130.00917.40
7.3.260.0150.00416.32
7.3.250.0120.00816.40
7.3.240.0130.00416.26
7.3.230.0130.01016.39
7.3.210.0120.00616.59
7.3.200.0090.01019.39
7.3.190.0120.00916.26
7.3.180.0090.00616.20
7.3.170.0100.01316.57
7.3.160.0080.00916.71
7.3.120.0050.00914.77
7.3.110.0100.00614.66
7.3.100.0060.00814.86
7.3.90.0090.00014.74
7.3.80.0070.00314.53
7.3.70.0120.00314.76
7.3.60.0040.01114.77
7.3.50.0030.00714.86
7.3.40.0070.00714.88
7.3.30.0000.00914.75
7.3.20.0070.00716.52
7.3.10.0020.00816.58
7.3.00.0070.00916.50
7.2.330.0100.01016.69
7.2.320.0090.00916.76
7.2.310.0090.00916.71
7.2.300.0000.01616.41
7.2.290.0040.01616.48
7.2.240.0030.01415.02
7.2.230.0030.01015.21
7.2.220.0070.00714.84
7.2.210.0060.00315.11
7.2.200.0080.00614.83
7.2.190.0040.00814.93
7.2.180.0060.00915.08
7.2.170.0070.00714.86
7.2.160.0040.01115.07
7.2.150.0030.01016.96
7.2.140.0060.00316.95
7.2.130.0130.00216.77
7.2.120.0080.00616.98
7.2.110.0020.01116.85
7.2.100.0020.01316.90
7.2.90.0070.00616.88
7.2.80.0030.00916.96
7.2.70.0120.00116.89
7.2.60.0040.00816.86
7.2.50.0030.01016.73
7.2.40.0050.00716.93
7.2.30.0060.00916.89
7.2.20.0090.00216.91
7.2.10.0080.00816.89
7.2.00.0030.00816.80
7.1.330.0040.00715.79
7.1.320.0030.01415.50
7.1.310.0080.00315.71
7.1.300.0080.00415.62
7.1.290.0070.00415.95
7.1.280.0060.00315.79
7.1.270.0030.00915.56
7.1.260.0030.01016.01
7.1.250.0060.00615.60
7.1.200.0060.00015.52
7.1.70.0050.00217.16
7.1.60.0060.01819.33
7.1.50.0070.01316.63
7.1.00.0070.07322.27
7.0.200.0000.01016.52
7.0.140.0030.07322.07
7.0.70.0000.09021.70
7.0.60.0000.06021.86
7.0.50.0100.07722.12
7.0.40.0070.04720.13
7.0.30.0030.07320.10
7.0.20.0130.07720.01
7.0.10.0000.08320.07
7.0.00.0000.08720.08
5.6.220.0070.07320.64
5.6.210.0170.06320.62
5.6.200.0000.05021.02
5.6.190.0030.07021.13
5.6.180.0070.06021.05
5.6.170.0070.04321.04
5.6.160.0070.08020.94
5.6.150.0000.06021.02
5.6.140.0030.07721.00
5.6.130.0000.04720.93
5.6.120.0000.06321.07
5.6.110.0000.06320.94
5.6.100.0030.08720.92
5.6.90.0030.08321.02
5.6.80.0070.05320.42
5.6.70.0130.05020.48
5.6.60.0070.08020.30
5.6.50.0030.07020.55
5.6.40.0000.08020.46
5.6.30.0030.05320.46
5.6.20.0070.07720.31
5.6.10.0030.07720.37
5.6.00.0100.05020.41
5.5.360.0000.08320.55
5.5.350.0100.08020.44
5.5.340.0030.04720.77
5.5.330.0000.08720.86
5.5.320.0030.08320.89
5.5.310.0000.09020.88
5.5.300.0000.09020.87
5.5.290.0030.08320.92
5.5.280.0030.08320.85
5.5.270.0070.05320.91
5.5.260.0100.08320.74
5.5.250.0070.08320.58
5.5.240.0000.08720.20
5.5.230.0100.03720.31
5.5.220.0030.06320.20
5.5.210.0100.04320.26
5.5.200.0030.05320.27
5.5.190.0070.08020.20
5.5.180.0070.08020.27
5.5.160.0000.05020.14
5.5.150.0100.06320.14
5.5.140.0070.04720.20
5.5.130.0030.08020.10
5.5.120.0070.07319.98
5.5.110.0030.08320.16
5.5.100.0070.08019.96
5.5.90.0000.08020.06
5.5.80.0070.04720.09
5.5.70.0070.06020.11
5.5.60.0130.05720.02
5.5.50.0070.07720.11
5.5.40.0030.07720.09
5.5.30.0000.06320.02
5.5.20.0070.06020.13
5.5.10.0100.08020.03
5.5.00.0000.04720.12
5.4.450.0030.08019.31
5.4.440.0030.06019.14
5.4.430.0030.08019.42
5.4.420.0030.07719.55
5.4.410.0030.08019.14
5.4.400.0030.07319.23
5.4.390.0000.08319.09
5.4.380.0030.03719.14
5.4.370.0000.04318.85
5.4.360.0000.05718.81
5.4.350.0100.05718.98
5.4.340.0070.06319.06
5.4.320.0070.07319.02
5.4.310.0030.07719.06
5.4.300.0070.07718.98
5.4.290.0030.08019.23
5.4.280.0030.04019.12
5.4.270.0100.06719.14
5.4.260.0100.07018.98
5.4.250.0030.07019.04
5.4.240.0070.05719.04
5.4.230.0100.07319.11
5.4.220.0030.07718.89
5.4.210.0030.07018.95
5.4.200.0100.07719.14
5.4.190.0000.04718.93
5.4.180.0030.07318.77
5.4.170.0000.04718.97
5.4.160.0030.05318.95
5.4.150.0000.04019.10
5.4.140.0000.05016.37
5.4.130.0030.06316.27
5.4.120.0070.06316.40
5.4.110.0100.04716.26
5.4.100.0100.06316.40
5.4.90.0000.07316.45
5.4.80.0070.07316.20
5.4.70.0100.06016.50
5.4.60.0100.07016.20
5.4.50.0100.07716.21
5.4.40.0000.05016.34
5.4.30.0070.06716.19
5.4.20.0000.07716.35
5.4.10.0030.04016.30
5.4.00.0030.05315.76
5.3.290.0030.04714.52
5.3.280.0030.07314.47
5.3.270.0070.07014.54
5.3.260.0030.08014.59
5.3.250.0030.04314.44
5.3.240.0030.04314.42
5.3.230.0100.07314.59
5.3.220.0030.05314.40
5.3.210.0030.05714.50
5.3.200.0000.07714.52
5.3.190.0030.05314.55
5.3.180.0030.04014.43
5.3.170.0030.07314.52
5.3.160.0070.07714.39
5.3.150.0000.06314.55
5.3.140.0100.04314.39
5.3.130.0070.07014.46
5.3.120.0070.06314.38
5.3.110.0030.05314.38
5.3.100.0100.03314.02
5.3.90.0100.06713.97
5.3.80.0000.07713.79
5.3.70.0030.05314.02
5.3.60.0030.07313.79
5.3.50.0000.06313.88
5.3.40.0100.07013.93
5.3.30.0070.05313.81
5.3.20.0030.06713.44
5.3.10.0030.07013.60
5.3.00.0000.05313.60
5.2.170.0030.06312.36
5.2.160.0100.05312.36
5.2.150.0030.06012.36
5.2.140.0000.06012.36
5.2.130.0000.06712.36
5.2.120.0000.06312.36
5.2.110.0070.05012.36
5.2.100.0030.03312.36
5.2.90.0030.04312.36
5.2.80.0070.06012.36
5.2.70.0070.05712.36
5.2.60.0070.05712.36
5.2.50.0030.04712.36
5.2.40.0000.06712.36
5.2.30.0000.05012.36
5.2.20.0030.05312.36
5.2.10.0030.04712.36
5.2.00.0000.06312.36
5.1.60.0070.02312.36
5.1.50.0030.04312.36
5.1.40.0170.04012.36
5.1.30.0000.05312.36
5.1.20.0070.04312.36
5.1.10.0030.05312.36
5.1.00.0070.05712.36
5.0.50.0030.04712.36
5.0.40.0000.04712.36
5.0.30.0070.06312.36
5.0.20.0030.03312.36
5.0.10.0000.04312.36
5.0.00.0030.05012.36
4.4.90.0000.03312.36
4.4.80.0000.02712.36
4.4.70.0030.03312.36
4.4.60.0000.02312.36
4.4.50.0030.03312.36
4.4.40.0000.04012.36
4.4.30.0000.03312.36
4.4.20.0070.03012.36
4.4.10.0030.03712.36
4.4.00.0000.05012.36
4.3.110.0000.03712.36
4.3.100.0000.03312.36
4.3.90.0030.03312.36
4.3.80.0000.05012.36
4.3.70.0000.03712.36
4.3.60.0030.03012.36
4.3.50.0000.04012.36
4.3.40.0030.04312.36
4.3.30.0030.03312.36
4.3.20.0000.04012.36
4.3.10.0000.04012.36
4.3.00.0000.03712.36

preferences:
53.09 ms | 400 KiB | 5 Q