3v4l.org

run code in 300+ PHP versions simultaneously
<?php function acquire_some_resource() { return new class { public function __construct() { echo "<locked>\n"; } public function __destruct() { echo "</locked>\n"; } }; } echo "acquire some_resource\n"; $some_resource = acquire_some_resource(); echo "create fn capturing some_resource by value\n"; $fn = function () use ($some_resource) { $some_resource = null; // this line actually doesn't have any effect }; echo "unset some_resource\n"; $some_resource = null; echo "call fn\n"; $fn(); echo "unset fn\n"; $fn = null; echo "DONE.\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.60.0080.00816.75
8.3.50.0200.00020.07
8.3.40.0120.00318.52
8.3.30.0130.00318.85
8.3.20.0030.00524.18
8.3.10.0000.00724.66
8.3.00.0080.00026.16
8.2.180.0120.00325.92
8.2.170.0100.01318.84
8.2.160.0140.00322.96
8.2.150.0080.00025.66
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0000.00726.16
8.2.110.0040.00420.38
8.2.100.0040.01118.22
8.2.90.0030.00518.33
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0080.00017.63
8.2.50.0030.00517.91
8.2.40.0000.00918.16
8.2.30.0080.00017.98
8.2.20.0000.00720.36
8.2.10.0050.00218.00
8.2.00.0100.00019.35
8.1.280.0140.00425.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0030.00720.28
8.1.230.0110.00020.91
8.1.220.0050.00317.79
8.1.210.0000.00818.77
8.1.200.0040.00417.36
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0030.00617.62
8.1.160.0070.00018.83
8.1.150.0000.00718.56
8.1.140.0030.00517.40
8.1.130.0030.00317.33
8.1.120.0030.00317.47
8.1.110.0070.00017.40
8.1.100.0030.00317.44
8.1.90.0030.00617.50
8.1.80.0040.00417.35
8.1.70.0060.00417.33
8.1.60.0030.01017.41
8.1.50.0070.01017.39
8.1.40.0130.00717.50
8.1.30.0130.00417.68
8.1.20.0130.00417.65
8.1.10.0120.00817.53
8.1.00.0130.00417.50
8.0.300.0000.00721.42
8.0.290.0080.00016.75
8.0.280.0000.00718.44
8.0.270.0000.00718.02
8.0.260.0000.00816.73
8.0.250.0030.00316.86
8.0.240.0000.00716.86
8.0.230.0060.00317.00
8.0.220.0030.00316.89
8.0.210.0000.00716.89
8.0.200.0110.00416.90
8.0.190.0100.00316.79
8.0.180.0000.01216.78
8.0.170.0060.00616.88
8.0.160.0070.00316.94
8.0.150.0110.00416.78
8.0.140.0030.00616.87
8.0.130.0070.00416.70
8.0.120.0040.00416.90
8.0.110.0000.00916.69
8.0.100.0030.00616.72
8.0.90.0070.00716.85
8.0.80.0060.00616.91
8.0.70.0110.00416.77
8.0.60.0030.00616.95
8.0.50.0070.00216.67
8.0.30.0070.00416.83
8.0.20.0100.00516.94
8.0.10.0120.00316.83
7.4.330.0000.00615.55
7.4.320.0030.00616.50
7.4.300.0160.00016.57
7.4.290.0130.00416.50
7.4.280.0110.00716.41
7.4.270.0130.00416.39
7.4.260.0130.00616.64
7.4.250.0040.01316.51
7.4.240.0140.00416.58
7.4.230.0150.00416.62
7.4.220.0120.00316.54
7.4.210.0110.00416.49
7.4.200.0100.00516.52
7.4.190.0130.00216.58
7.4.180.0080.00316.61
7.4.160.0050.00516.65
7.4.150.0100.00016.59
7.4.140.0000.01016.36
7.4.130.0040.00816.46
7.4.120.0090.00316.57
7.4.110.0100.00416.36
7.4.100.0110.00416.51
7.4.90.0110.00516.42
7.4.80.0090.00616.42
7.4.70.0080.00316.52
7.4.60.0050.00516.55
7.4.50.0050.00516.37
7.4.40.0000.01016.29
7.4.30.0050.00516.34
7.4.20.0080.00016.43
7.4.10.0100.00016.54
7.4.00.0060.00416.46

preferences:
31.02 ms | 400 KiB | 5 Q