3v4l.org

run code in 300+ PHP versions simultaneously
<?php // plain variable $a = 42; // array containing a reference $b = [ 'a' => &$a ]; // capture the array by-value $f = function() use($b) { // update the reference from inside the closure $b['a'] = 69; }; // call it $f(); // observe that both the array and the plain variable now have the new value var_dump($a, $b);

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.0070.00718.56
8.3.50.0120.00620.15
8.3.40.0120.00618.82
8.3.30.0120.00618.48
8.3.20.0000.00824.18
8.3.10.0050.00224.66
8.3.00.0060.00326.16
8.2.180.0090.00925.92
8.2.170.0130.01018.87
8.2.160.0030.01022.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0070.00021.05
8.2.110.0030.00621.03
8.2.100.0120.00017.91
8.2.90.0040.00417.78
8.2.80.0080.00019.13
8.2.70.0090.00017.63
8.2.60.0080.00017.50
8.2.50.0050.00317.98
8.2.40.0080.00019.84
8.2.30.0040.00418.11
8.2.20.0040.00420.31
8.2.10.0030.00518.13
8.2.00.0040.00419.28
8.1.280.0100.00325.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00623.82
8.1.230.0000.01121.03
8.1.220.0030.00617.75
8.1.210.0000.00918.77
8.1.200.0000.00817.36
8.1.190.0030.00517.35
8.1.180.0080.00018.10
8.1.170.0040.00417.62
8.1.160.0040.00418.79
8.1.150.0080.00018.68
8.1.140.0080.00017.49
8.1.130.0020.00518.90
8.1.120.0050.00317.39
8.1.110.0040.00417.35
8.1.100.0030.00417.48
8.1.90.0040.00417.47
8.1.80.0080.00017.46
8.1.70.0050.00417.42
8.1.60.0080.00817.52
8.1.50.0090.00617.47
8.1.40.0090.00617.49
8.1.30.0110.00317.56
8.1.20.0040.00717.63
8.1.10.0040.00817.57
8.1.00.0060.00717.49
8.0.300.0040.00419.89
8.0.290.0060.00616.63
8.0.280.0070.00018.37
8.0.270.0000.00816.73
8.0.260.0000.00718.53
8.0.250.0030.00316.80
8.0.240.0000.00716.91
8.0.230.0000.00716.96
8.0.220.0000.00816.91
8.0.210.0070.00016.81
8.0.200.0070.00416.79
8.0.190.0060.00616.89
8.0.180.0100.00316.85
8.0.170.0090.00516.84
8.0.160.0080.00516.73
8.0.150.0070.00516.80
8.0.140.0060.00716.85
8.0.130.0070.00316.77
8.0.120.0060.00616.71
8.0.110.0090.00716.72
8.0.100.0140.00316.64
8.0.90.0090.00616.80
8.0.80.0140.00216.78
8.0.70.0100.00416.78
8.0.60.0100.00916.76
8.0.50.0070.00716.70
8.0.30.0090.00516.79
8.0.20.0080.00616.88
8.0.10.0090.00316.86
7.4.330.0040.00015.55
7.4.320.0030.00316.41
7.4.300.0070.00416.41
7.4.290.0120.00116.54
7.4.280.0070.00416.44
7.4.270.0060.00616.46
7.4.260.0090.00416.52
7.4.250.0040.00716.52
7.4.240.0090.00316.58
7.4.230.0070.00816.36
7.4.220.0090.00516.18
7.4.210.0090.00316.18
7.4.200.0090.00416.20
7.4.190.0100.00316.46
7.4.180.0070.00616.47
7.4.160.0120.00116.29
7.4.150.0040.00816.29
7.4.140.0100.00216.42
7.4.130.0100.00416.37
7.4.120.0100.00116.17
7.4.110.0070.00516.29
7.4.100.0070.00516.51
7.4.90.0090.00316.40
7.4.80.0050.00716.28
7.4.70.0090.00416.23
7.4.60.0110.00316.22
7.4.50.0060.00716.32
7.4.40.0070.00516.25
7.4.30.0080.00516.00
7.4.20.0080.00416.40
7.4.10.0100.00316.42
7.4.00.0070.00616.31

preferences:
55.03 ms | 401 KiB | 5 Q