3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = "unchecked"; $a = array(1, 2, 3, "is_ref" => &$x); foreach ($a as $k => $v) { if ($k !== "is_ref") { /* CODE FOR TESTING HERE */ // This will cause a copy: //$a[$k] = null; //$v += 1; //$a[$k] = $v; // This won't: //var_dump($a); } else if (isset($x)) { $x = "was not copied"; unset($x); $tmp = $a; $tmp["is_ref"] = "WAS COPIED!!!"; unset($tmp); echo "######### \$a ".$a["is_ref"]."\n"; } }

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.120.0110.00418.86
8.3.110.0110.00720.94
8.3.100.0030.00624.06
8.3.90.0060.00326.77
8.3.80.0040.00418.43
8.3.70.0160.00618.25
8.3.60.0130.00616.50
8.3.50.0130.00718.25
8.3.40.0150.00018.97
8.3.30.0040.01118.67
8.3.20.0040.00421.82
8.3.10.0080.00023.71
8.3.00.0050.00317.80
8.2.240.0090.00016.97
8.2.230.0080.00322.58
8.2.220.0040.01537.54
8.2.210.0140.00026.77
8.2.200.0060.00316.50
8.2.190.0110.00816.58
8.2.180.0120.00618.11
8.2.170.0100.01022.96
8.2.160.0100.00319.46
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0060.00322.20
8.2.120.0060.00326.35
8.2.110.0040.00720.99
8.2.100.0040.00818.03
8.2.90.0040.00418.16
8.2.80.0000.00720.53
8.2.70.0000.00817.63
8.2.60.0060.00617.50
8.2.50.0080.00017.63
8.2.40.0000.00822.28
8.2.30.0040.00419.32
8.2.20.0000.00718.06
8.2.10.0050.00317.98
8.2.00.0070.00018.12
8.1.300.0110.00418.11
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0000.00823.90
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0110.00422.23
8.1.230.0060.00621.04
8.1.220.0000.00817.74
8.1.210.0060.00318.96
8.1.200.0030.00517.48
8.1.190.0030.00617.36
8.1.180.0030.00518.10
8.1.170.0000.00818.65
8.1.160.0080.00022.07
8.1.150.0050.00518.79
8.1.140.0070.00019.57
8.1.130.0070.00018.83
8.1.120.0070.00017.44
8.1.110.0000.00717.36
8.1.100.0040.00417.34
8.1.90.0070.00317.50
8.1.80.0040.00417.31
8.1.70.0000.00817.45
8.1.60.0040.00417.53
8.1.50.0040.00417.41
8.1.40.0040.00417.43
8.1.30.0080.00017.65
8.1.20.0080.00017.69
8.1.10.0000.00717.45
8.1.00.0000.00717.37
8.0.300.0040.00420.22
8.0.290.0040.00416.63
8.0.280.0000.00718.44
8.0.270.0000.00716.81
8.0.260.0000.00717.29
8.0.250.0030.00516.86
8.0.240.0050.00216.88
8.0.230.0030.00316.82
8.0.220.0030.00316.91
8.0.210.0040.00416.79
8.0.200.0000.00816.89
8.0.190.0030.00516.81
8.0.180.0110.00016.88
8.0.170.0000.00716.80
8.0.160.0000.00816.79
8.0.150.0030.00316.87
8.0.140.0070.00016.70
8.0.130.0000.00613.37
8.0.120.0070.00016.82
8.0.110.0030.00316.86
8.0.100.0070.00016.74
8.0.90.0000.00717.00
8.0.80.0120.00316.92
8.0.70.0050.00216.78
8.0.60.0050.00316.95
8.0.50.0040.00416.74
8.0.30.0120.00916.95
8.0.20.0090.01217.40
8.0.10.0020.00516.90
8.0.00.0100.00716.64
7.4.330.0040.00015.55
7.4.320.0030.00316.58
7.4.300.0000.00616.57
7.4.290.0000.00716.41
7.4.280.0070.00016.39
7.4.270.0000.00716.62
7.4.260.0070.00016.53
7.4.250.0060.00316.51
7.4.240.0040.00416.60
7.4.230.0030.00316.61
7.4.220.0170.00316.63
7.4.210.0040.01116.46
7.4.200.0030.00316.30
7.4.160.0120.00416.50
7.4.150.0030.01417.40
7.4.140.0140.00717.86
7.4.130.0030.01416.56
7.4.120.0060.01516.57
7.4.110.0100.00716.49
7.4.100.0060.01316.43
7.4.90.0030.01316.45
7.4.80.0100.00719.39
7.4.70.0130.00416.53
7.4.60.0100.00716.47
7.4.50.0060.00916.40
7.4.40.0040.01716.64
7.4.30.0160.00016.33
7.4.00.0030.01314.74
7.3.330.0000.00813.22
7.3.320.0030.00313.17
7.3.310.0040.00516.19
7.3.300.0000.00716.23
7.3.290.0060.00916.29
7.3.280.0090.00916.31
7.3.270.0090.00917.40
7.3.260.0130.00416.64
7.3.250.0080.00916.47
7.3.240.0110.00816.49
7.3.230.0140.00316.51
7.3.210.0100.00716.62
7.3.200.0060.01016.45
7.3.190.0090.01216.45
7.3.180.0090.00616.27
7.3.170.0130.00816.41
7.3.160.0030.01216.33
7.2.330.0090.00916.69
7.2.320.0140.00716.77
7.2.310.0060.01016.63
7.2.300.0080.01116.87
7.2.290.0070.01816.76
7.2.60.0100.00616.75
7.2.00.0030.00619.27
7.1.200.0090.00615.77
7.1.70.0040.00417.19
7.1.60.0030.01016.95
7.1.50.0080.00317.02
7.1.40.0030.01016.64
7.1.30.0040.00716.56
7.1.20.0050.00516.53
7.1.10.0030.00616.88
7.1.00.0090.00316.99
7.0.200.0040.00416.70
7.0.190.0030.00516.46
7.0.180.0040.00416.30
7.0.170.0040.00416.36
7.0.160.0000.00816.27
7.0.150.0030.00616.18
7.0.140.0030.00616.47
7.0.130.0040.00416.86
7.0.120.0000.00816.86
7.0.110.0030.01016.35
7.0.100.0000.01216.45
7.0.90.0000.00816.27
7.0.80.0000.00816.65
7.0.70.0000.00816.23
7.0.60.0000.01616.21
7.0.50.0000.01316.33
7.0.40.0000.00715.71
7.0.30.0050.00215.71
7.0.20.0000.00815.71
7.0.10.0000.01215.71
7.0.00.0030.00715.71

preferences:
29 ms | 403 KiB | 5 Q