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'); } 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.3.60.0120.00618.56
8.3.50.0030.01018.08
8.3.40.0060.00918.84
8.3.30.0140.00418.82
8.3.20.0040.00420.34
8.3.10.0000.00821.75
8.3.00.0050.00519.36
8.2.180.0070.01418.55
8.2.170.0140.00022.96
8.2.160.0100.00320.35
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00022.16
8.2.120.0080.00026.35
8.2.110.0060.00319.32
8.2.100.0090.00317.84
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0040.00417.75
8.2.60.0030.00518.04
8.2.50.0040.00418.10
8.2.40.0040.00420.46
8.2.30.0040.00419.30
8.2.20.0000.00818.07
8.2.10.0030.00618.06
8.2.00.0040.00418.16
8.1.280.0090.00625.92
8.1.270.0090.00020.23
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0090.00022.37
8.1.230.0100.00017.82
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0090.00017.35
8.1.190.0040.00417.47
8.1.180.0040.00418.10
8.1.170.0080.00018.64
8.1.160.0000.00718.94
8.1.150.0000.00718.95
8.1.140.0080.00017.58
8.1.130.0040.00420.80
8.1.120.0000.00717.35
8.1.110.0070.00017.37
8.1.100.0000.01017.49
8.1.90.0080.00317.46
8.1.80.0030.00617.46
8.1.70.0000.00717.46
8.1.60.0000.00817.43
8.1.50.0040.00417.55
8.1.40.0040.00417.35
8.1.30.0000.00917.55
8.1.20.0060.00317.55
8.1.10.0070.00417.63
8.1.00.0000.00817.54
8.0.300.0000.00718.77
8.0.290.0050.00216.75
8.0.280.0030.00318.35
8.0.270.0030.00317.13
8.0.260.0000.00618.50
8.0.250.0030.00316.95
8.0.240.0070.00016.93
8.0.230.0000.00717.00
8.0.220.0070.00017.01
8.0.210.0000.00716.94
8.0.200.0000.00717.06
8.0.190.0050.00217.01
8.0.180.0070.00016.94
8.0.170.0030.00616.94
8.0.160.0040.00416.96
8.0.150.0040.00416.85
8.0.140.0050.00216.87
8.0.130.0080.00013.39
8.0.120.0060.00316.95
8.0.110.0030.00316.88
8.0.100.0000.00816.94
8.0.90.0080.00016.82
8.0.80.0100.00717.00
8.0.70.0040.00416.85
8.0.60.0040.00416.91
8.0.50.0050.00216.77
8.0.30.0110.00817.08
8.0.20.0110.00917.40
8.0.10.0030.00517.07
8.0.00.0100.00716.77
7.4.330.0020.00215.55
7.4.320.0030.00616.57
7.4.300.0030.00316.48
7.4.290.0040.00416.41
7.4.280.0000.00816.61
7.4.270.0000.00716.52
7.4.260.0030.00316.60
7.4.250.0050.00316.55
7.4.240.0040.00416.49
7.4.230.0000.00716.61
7.4.220.0070.00016.58
7.4.210.0030.01516.45
7.4.200.0000.00716.60
7.4.160.0100.00816.56
7.4.150.0070.01017.40
7.4.140.0100.00717.86
7.4.130.0120.00916.54
7.4.120.0080.00916.61
7.4.110.0120.00416.64
7.4.100.0150.00716.74
7.4.90.0040.01516.52
7.4.80.0110.00819.39
7.4.70.0130.01016.67
7.4.60.0100.00716.58
7.4.50.0060.01016.31
7.4.40.0080.00816.55
7.4.00.0050.01114.80
7.3.330.0030.00313.22
7.3.320.0000.00613.21
7.3.310.0040.00416.39
7.3.300.0030.00316.38
7.3.290.0100.00716.34
7.3.280.0040.01016.37
7.3.270.0090.00917.40
7.3.260.0120.01116.39
7.3.250.0090.01116.47
7.3.240.0080.01516.46
7.3.230.0080.00816.53
7.3.210.0060.01116.32
7.3.200.0060.01016.38
7.3.190.0100.01016.28
7.3.180.0080.00816.39
7.3.170.0150.00016.52
7.3.160.0000.01616.33
7.2.330.0070.01016.73
7.2.320.0140.00316.75
7.2.310.0130.00316.80
7.2.300.0080.01116.71
7.2.290.0070.01016.38
7.2.60.0120.00317.08
7.2.10.0440.01517.97
7.2.00.0400.01017.73
7.1.200.0070.00315.95
7.1.130.0370.01016.72
7.1.120.0310.00816.58
7.1.110.0570.00615.88
7.1.100.0370.00615.94
7.1.90.0350.00616.02
7.1.80.0220.00716.09
7.1.70.0230.00515.22
7.1.60.0520.00733.12
7.1.50.0390.01833.04
7.1.40.0570.00832.57
7.1.30.0440.01332.71
7.1.20.0430.01132.65
7.1.10.0350.01014.80
7.1.00.0340.00714.77

preferences:
64.27 ms | 400 KiB | 5 Q