3v4l.org

run code in 300+ PHP versions simultaneously
<?php function shenanigans(string &$foo) { return function () use (&$foo) { $foo = 'But this action at a distance is annoying.'; }; $foo = "I can expect it is changed inside function"; } $somestring = "original value"; $fn = shenanigans($somestring); var_dump($somestring); // many lines of code here // many lines of code here // many lines of code here $fn(); var_dump($somestring);

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.5.30.0090.00819.60
8.5.20.0110.00719.48
8.5.10.0110.00519.93
8.5.00.0130.00919.97
8.4.180.0110.01119.69
8.4.170.0120.00922.06
8.4.160.0110.01423.71
8.4.150.0110.00416.88
8.4.140.0130.01017.57
8.4.130.0110.01018.60
8.4.120.0080.00817.83
8.4.110.0130.00717.61
8.4.100.0050.00417.74
8.4.90.0100.01120.70
8.4.80.0100.00818.98
8.4.70.0110.00818.60
8.4.60.0120.01318.82
8.4.50.0130.00822.12
8.4.40.0130.00720.50
8.4.30.0060.01218.99
8.4.20.0080.01225.54
8.4.10.0100.00723.87
8.3.300.0090.00920.80
8.3.290.0170.00620.80
8.3.280.0120.00918.31
8.3.270.0120.00716.73
8.3.260.0080.00716.68
8.3.250.0080.01116.46
8.3.240.0060.00416.62
8.3.230.0110.00516.66
8.3.220.0130.00618.77
8.3.210.0040.00418.55
8.3.200.0040.00516.33
8.3.190.0050.00316.95
8.3.180.0100.00719.00
8.3.170.0090.01216.50
8.3.160.0090.00917.19
8.3.150.0110.00717.17
8.3.140.0160.00320.84
8.3.130.0170.00018.22
8.3.120.0060.01220.70
8.3.110.0040.00420.94
8.3.100.0080.00024.06
8.3.90.0180.00426.77
8.3.80.0090.00017.97
8.3.70.0150.00618.05
8.3.60.0040.01116.50
8.3.50.0120.00316.56
8.3.40.0000.01520.22
8.3.30.0070.00718.61
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0000.00826.16
8.2.300.0080.01222.18
8.2.290.0110.00816.58
8.2.280.0120.01118.75
8.2.270.0120.00620.65
8.2.260.0070.01116.81
8.2.250.0150.00316.52
8.2.240.0000.00817.01
8.2.230.0110.00422.58
8.2.220.0160.00637.54
8.2.210.0150.00326.77
8.2.200.0090.00016.63
8.2.190.0140.00418.21
8.2.180.0110.00716.63
8.2.170.0120.00618.79
8.2.160.0100.01022.96
8.2.150.0000.00825.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0030.00622.21
8.2.100.0090.00317.72
8.2.90.0040.00418.03
8.2.80.0050.00317.63
8.2.70.0160.00817.25
8.2.60.0000.00817.91
8.2.50.0040.00418.07
8.2.40.0000.00821.02
8.2.30.0040.00417.88
8.2.20.0000.00819.17
8.2.10.0050.00218.00
8.2.00.0100.00717.73
8.1.340.0070.01317.62
8.1.330.0100.00816.02
8.1.320.0160.00317.86
8.1.310.0000.00816.44
8.1.300.0150.00317.87
8.1.290.0080.00330.84
8.1.280.0100.00725.92
8.1.270.0080.00024.66
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00022.55
8.1.230.0070.00420.86
8.1.220.0000.00817.79
8.1.210.0040.00418.96
8.1.200.0030.00717.35
8.1.190.0000.00717.35
8.1.180.0000.00818.10
8.1.170.0040.00418.47
8.1.160.0000.00718.95
8.1.150.0000.00718.57
8.1.140.0040.00417.50
8.1.130.0080.00817.39
8.1.120.0140.00317.45
8.1.110.0100.00717.46
8.1.100.0110.00617.45
8.1.90.0090.00917.46
8.1.80.0130.00417.37
8.1.70.0160.00017.45
8.1.60.0090.00917.54
8.1.50.0150.00417.48
8.1.40.0120.00817.50
8.1.30.0180.00217.59
8.1.20.0150.00417.65
8.1.10.0110.00717.45
8.1.00.0100.01017.51
8.0.300.0040.00419.89
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0050.00218.02
8.0.260.0140.00416.81
8.0.250.0140.00416.87
8.0.240.0110.00716.87
8.0.230.0140.00316.93
8.0.220.0110.00516.76
8.0.210.0080.00816.81
8.0.200.0140.00416.81
8.0.190.0160.00016.87
8.0.180.0120.00416.87
8.0.170.0150.00016.89
8.0.160.0080.00816.75
8.0.150.0040.01116.68
8.0.140.0120.00416.79
8.0.130.0150.00016.80
8.0.120.0100.00516.86
8.0.110.0130.00316.80
8.0.100.0120.00416.67
8.0.90.0120.00516.79
8.0.80.0080.00816.72
8.0.70.0100.00516.70
8.0.60.0090.00616.80
8.0.50.0070.00716.85
8.0.30.0090.00916.80
8.0.20.0160.00016.79
8.0.10.0160.00016.80

preferences:
90.76 ms | 1108 KiB | 5 Q