3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ResourceType { public function __destruct() { echo "Resource is released.\n"; } } function get_callback() { $some_resource = new ResourceType(); $fn = function() use($some_resource) { // // why is my lock released? var_dump($some_resource); // "Free that resource" $some_resource = null; }; return $fn; } $fn = get_callback(); echo "Before callback\n"; $fn(); echo "After callback\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.4.120.0100.00924.07
8.4.110.0140.00618.95
8.4.100.0150.00517.70
8.4.90.0140.00618.44
8.4.80.0110.00617.69
8.4.70.0130.00817.93
8.4.60.0060.00220.23
8.4.50.0140.00624.05
8.4.40.0090.00919.73
8.4.30.0070.00418.68
8.4.20.0090.00020.72
8.4.10.0090.00021.76
8.3.250.0100.00818.83
8.3.240.0130.00617.11
8.3.230.0130.00616.32
8.3.220.0090.00917.30
8.3.210.0120.00416.54
8.3.200.0030.00616.36
8.3.190.0090.01016.74
8.3.180.0130.00618.34
8.3.170.0040.00416.37
8.3.160.0100.00717.13
8.3.150.0160.00317.09
8.3.140.0120.00618.97
8.3.130.0030.00518.22
8.3.120.0090.00920.49
8.3.110.0100.01020.94
8.3.100.0040.00424.06
8.3.90.0080.00026.77
8.3.80.0040.00718.43
8.3.70.0110.00716.58
8.3.60.0100.00616.75
8.3.50.0150.00620.09
8.3.40.0120.00318.84
8.3.30.0090.00618.89
8.3.20.0030.00624.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.290.0130.00522.41
8.2.280.0060.00320.24
8.2.270.0100.01016.63
8.2.260.0050.00317.29
8.2.250.0000.00916.42
8.2.240.0100.00617.35
8.2.230.0060.00322.58
8.2.220.0000.00837.54
8.2.210.0070.00026.77
8.2.200.0080.00416.50
8.2.190.0100.00716.63
8.2.180.0070.00725.92
8.2.170.0090.00918.95
8.2.160.0180.00022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0060.00320.56
8.2.110.0160.00322.20
8.2.100.0110.00017.91
8.2.90.0080.00017.84
8.2.80.0080.00017.97
8.2.70.0000.00817.63
8.2.60.0050.00317.93
8.2.50.0080.00018.07
8.2.40.0030.00518.16
8.2.30.0000.00717.95
8.2.20.0040.00420.47
8.2.10.0000.00718.05
8.2.00.0000.00819.28
8.1.330.0050.00722.11
8.1.320.0090.01116.32
8.1.310.0080.00016.93
8.1.300.0090.01216.23
8.1.290.0040.00730.84
8.1.280.0120.00625.92
8.1.270.0000.00723.99
8.1.260.0000.00926.35
8.1.250.0070.00028.09
8.1.240.0040.00422.54
8.1.230.0040.00820.74
8.1.220.0000.00817.79
8.1.210.0040.00418.85
8.1.200.0060.00317.35
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0080.00018.64
8.1.160.0000.00718.88
8.1.150.0000.00718.68
8.1.140.0000.00717.52
8.1.130.0040.00417.36
8.1.120.0040.00417.35
8.1.110.0050.00317.46
8.1.100.0050.00217.40
8.1.90.0000.00817.43
8.1.80.0050.00217.45
8.1.70.0060.00717.41
8.1.60.0100.00517.51
8.1.50.0110.00517.44
8.1.40.0120.00417.43
8.1.30.0130.00417.54
8.1.20.0100.00617.52
8.1.10.0110.00617.46
8.1.00.0100.00617.40
8.0.300.0030.00519.86
8.0.290.0070.00016.75
8.0.280.0030.00318.45
8.0.270.0000.00716.82
8.0.260.0030.00316.68
8.0.250.0070.00016.95
8.0.240.0040.00416.91
8.0.230.0040.00416.82
8.0.220.0040.00416.84
8.0.210.0000.00716.88
8.0.200.0060.00516.84
8.0.190.0080.00616.79
8.0.180.0090.00516.74
8.0.170.0110.00316.76
8.0.160.0100.00516.75
8.0.150.0110.00416.71
8.0.140.0070.00816.73
8.0.130.0110.00416.76
8.0.120.0100.00416.75
8.0.110.0090.00516.75
8.0.100.0100.00516.72
8.0.90.0090.00616.68
8.0.80.0080.00616.65
8.0.70.0090.00516.71
8.0.60.0090.00516.70
8.0.50.0080.00716.69
8.0.30.0100.00516.74
8.0.20.0110.00416.80
8.0.10.0110.00416.85
7.4.330.0000.00515.55
7.4.320.0060.00016.51
7.4.300.0100.00416.47
7.4.290.0110.00316.41
7.4.280.0110.00416.44
7.4.270.0120.00416.42
7.4.260.0100.00516.47
7.4.250.0120.00416.39
7.4.240.0110.00516.35
7.4.230.0120.00416.46
7.4.220.0090.00516.41
7.4.210.0080.00616.33
7.4.200.0100.00516.36
7.4.190.0070.00616.46
7.4.180.0080.00416.31
7.4.160.0070.00416.35
7.4.150.0060.00616.32
7.4.140.0090.00416.21
7.4.130.0080.00416.25
7.4.120.0070.00516.32
7.4.110.0060.00616.28
7.4.100.0100.00316.35
7.4.90.0080.00516.26
7.4.80.0060.00616.33
7.4.70.0070.00416.27
7.4.60.0070.00416.33
7.4.50.0070.00516.23
7.4.40.0040.00616.26
7.4.30.0080.00316.29
7.4.20.0070.00416.33
7.4.10.0060.00516.34
7.4.00.0060.00616.35

preferences:
29.06 ms | 403 KiB | 5 Q