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.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.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.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:
38.5 ms | 406 KiB | 5 Q