3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tr { public $s; /** * Tr constructor. * @param $s */ public function __construct($s) { $this->s = $s; } public function __destruct() { echo "__destruct $this->s" . PHP_EOL; } } function b() { $tr = new Tr('b'); echo 'b' . PHP_EOL; c($tr); // If exception thrown here, Tr::__destruct is called // throw new \Exception('ee'); // Or if you call c() without passing $tr, Tr::__destruct is called } /** * @param Tr $tr */ function c($tr = null) { throw new \Exception('ee'); } try { b(); } catch(\Exception $ex) { echo 'catch'. PHP_EOL; throw $ex; }

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.0060.00918.55
8.3.50.0140.00018.04
8.3.40.0040.01518.97
8.3.30.0040.01418.79
8.3.20.0080.00020.36
8.3.10.0080.00021.77
8.3.00.0000.00819.38
8.2.180.0090.00918.26
8.2.170.0120.00322.96
8.2.160.0000.01420.30
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0050.00222.13
8.2.120.0000.00826.35
8.2.110.0060.00319.30
8.2.100.0090.00317.57
8.2.90.0030.00619.21
8.2.80.0080.00019.19
8.2.70.0030.00617.63
8.2.60.0060.00318.04
8.2.50.0020.00518.10
8.2.40.0040.00420.24
8.2.30.0040.00419.21
8.2.20.0000.00818.02
8.2.10.0040.00418.10
8.2.00.0040.00418.30
8.1.280.0040.01125.92
8.1.270.0080.00020.34
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0100.00022.19
8.1.230.0090.00317.70
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0060.00317.38
8.1.190.0000.00817.23
8.1.180.0080.00018.10
8.1.170.0030.00618.54
8.1.160.0040.00418.82
8.1.150.0000.00718.94
8.1.140.0000.00817.71
8.1.130.0000.00719.09
8.1.120.0030.00317.51
8.1.110.0000.00717.45
8.1.100.0000.00717.36
8.1.90.0040.00417.44
8.1.80.0030.00617.47
8.1.70.0030.00317.46
8.1.60.0000.00817.59
8.1.50.0030.00617.44
8.1.40.0000.00717.55
8.1.30.0050.00317.65
8.1.20.0040.00417.60
8.1.10.0000.00817.57
8.1.00.0050.00317.52
8.0.300.0040.00418.77
8.0.290.0000.00716.58
8.0.280.0000.00818.52
8.0.270.0030.00317.29
8.0.260.0030.00318.52
8.0.250.0030.00317.10
8.0.240.0040.00416.94
8.0.230.0000.00717.00
8.0.220.0000.00716.86
8.0.210.0030.00316.86
8.0.200.0070.00017.02
8.0.190.0000.00917.07
8.0.180.0000.00816.93
8.0.170.0030.00517.00
8.0.160.0000.00717.05
8.0.150.0030.00516.96
8.0.140.0030.00616.97
8.0.130.0080.00013.45
8.0.120.0060.00316.86
8.0.110.0040.00416.94
8.0.100.0070.00017.03
8.0.90.0000.00816.82
8.0.80.0060.01116.94
8.0.70.0000.00716.75
8.0.60.0000.00716.95
8.0.50.0070.00016.87
8.0.30.0090.00917.16
8.0.20.0100.01017.40
8.0.10.0000.00716.95
8.0.00.0120.00716.70
7.4.330.0000.00415.55
7.4.320.0050.00516.67
7.4.300.0030.00316.46
7.4.290.0030.00316.57
7.4.280.0040.00416.41
7.4.270.0070.00016.58
7.4.260.0030.00316.36
7.4.250.0000.01016.55
7.4.240.0000.00716.62
7.4.230.0030.00316.51
7.4.220.0030.00316.41
7.4.210.0070.01316.52
7.4.200.0040.00416.64
7.4.160.0080.01116.54
7.4.150.0070.01517.40
7.4.140.0100.01117.86
7.4.130.0030.01516.45
7.4.120.0110.00716.63
7.4.110.0090.00916.49
7.4.100.0120.00616.51
7.4.90.0070.01416.53
7.4.80.0140.00819.39
7.4.70.0070.01316.36
7.4.60.0090.00616.61
7.4.50.0040.01116.37
7.4.40.0150.00616.65
7.4.00.0140.00315.06
7.3.330.0060.00013.27
7.3.320.0000.00613.23
7.3.310.0000.00816.41
7.3.300.0070.00016.22
7.3.290.0080.01016.40
7.3.280.0090.00516.38
7.3.270.0090.00917.40
7.3.260.0100.01116.37
7.3.250.0120.00616.52
7.3.240.0100.00916.45
7.3.230.0070.01016.41
7.3.210.0070.01116.48
7.3.200.0130.00316.33
7.3.190.0070.01016.50
7.3.180.0100.00716.51
7.3.170.0150.00316.47
7.3.160.0120.00416.52
7.3.10.0090.00516.66
7.3.00.0020.01516.68
7.2.330.0130.00616.83
7.2.320.0030.01516.45
7.2.310.0080.00816.81
7.2.300.0140.00616.64
7.2.290.0030.01316.75
7.2.130.0140.00516.71
7.2.120.0120.00816.82
7.2.110.0120.00716.81
7.2.100.0100.00816.90
7.2.90.0090.00816.85
7.2.80.0120.00716.85
7.2.70.0110.01116.81
7.2.60.0120.00716.94
7.2.50.0130.00417.02
7.2.40.0090.01516.98
7.2.30.0090.00917.02
7.2.20.0130.00816.73
7.2.10.0190.00917.31
7.2.00.0190.00617.21
7.1.250.0130.00215.80
7.1.200.0000.01615.62
7.1.130.0240.01216.82
7.1.120.0280.01116.90
7.1.110.0340.00716.21
7.1.100.0320.01016.14
7.1.90.0340.01216.06
7.1.80.0310.00316.27
7.1.70.0250.01115.43
7.1.60.0600.02033.29
7.1.50.0520.00732.91
7.1.40.0550.02332.64
7.1.30.0490.01432.64
7.1.20.0510.01232.86
7.1.10.0330.00914.95
7.1.00.0660.00714.91

preferences:
47.81 ms | 400 KiB | 5 Q