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; try { c($tr); } catch(\Exception $ex) { } // 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.0110.00418.43
8.3.50.0110.00718.38
8.3.40.0100.00618.83
8.3.30.0110.00718.94
8.3.20.0040.00420.34
8.3.10.0040.00421.77
8.3.00.0060.00319.38
8.2.180.0120.00616.50
8.2.170.0070.00722.96
8.2.160.0070.00722.13
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00422.26
8.2.120.0050.00326.35
8.2.110.0070.00422.11
8.2.100.0090.00317.91
8.2.90.0070.00020.58
8.2.80.0090.00317.97
8.2.70.0070.00317.75
8.2.60.0040.00418.04
8.2.50.0080.00018.10
8.2.40.0040.00420.61
8.2.30.0040.00419.31
8.2.20.0000.00817.91
8.2.10.0070.00018.06
8.2.00.0040.00318.26
8.1.270.0040.00420.38
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0110.00622.19
8.1.230.0080.00322.56
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0000.00917.25
8.1.190.0000.00916.99
8.1.180.0080.00018.10
8.1.170.0040.00418.38
8.1.160.0000.00718.82
8.1.150.0090.00018.88
8.1.140.0100.00017.59
8.1.130.0030.00318.95
8.1.120.0050.00217.50
8.1.110.0000.00717.48
8.1.100.0020.00517.47
8.1.90.0000.00717.46
8.1.80.0070.00417.43
8.1.70.0070.00017.40
8.1.60.0040.00417.57
8.1.50.0000.00817.41
8.1.40.0040.00417.52
8.1.30.0000.00817.71
8.1.20.0040.00417.64
8.1.10.0040.00417.52
8.1.00.0050.00517.55
8.0.300.0050.00220.04
8.0.290.0000.00816.63
8.0.280.0040.00418.37
8.0.270.0000.00817.33
8.0.260.0030.00318.45
8.0.250.0000.00717.05
8.0.240.0040.00416.91
8.0.230.0000.00817.04
8.0.220.0000.00716.97
8.0.210.0000.00717.02
8.0.200.0060.00016.89
8.0.190.0000.00716.96
8.0.180.0000.00717.00
8.0.170.0030.00616.96
8.0.160.0080.00017.04
8.0.150.0040.00416.88
8.0.140.0000.00716.86
8.0.130.0000.00613.41
8.0.120.0000.00716.82
8.0.110.0070.00016.97
8.0.100.0000.00716.82
8.0.90.0000.00717.01
8.0.80.0060.00916.86
8.0.70.0040.00416.74
8.0.60.0000.00716.78
8.0.50.0070.00016.96
8.0.30.0090.00817.08
8.0.20.0090.00917.40
8.0.10.0040.00417.09
8.0.00.0050.01316.77
7.4.330.0030.00316.67
7.4.320.0050.00216.53
7.4.300.0040.00416.52
7.4.290.0030.00316.50
7.4.280.0070.00016.42
7.4.270.0030.00316.61
7.4.260.0000.00716.50
7.4.250.0030.00516.43
7.4.240.0070.00016.38
7.4.230.0070.00016.48
7.4.220.0030.00316.64
7.4.210.0090.00916.57
7.4.200.0080.00016.69
7.4.160.0060.01116.39
7.4.150.0090.00917.40
7.4.140.0130.00717.86
7.4.130.0070.01016.58
7.4.120.0100.01216.64
7.4.110.0000.01616.41
7.4.100.0070.01016.39
7.4.90.0090.00916.62
7.4.80.0050.01519.39
7.4.70.0120.00916.46
7.4.60.0060.00916.56
7.4.50.0040.01416.34
7.4.40.0110.00716.41
7.4.10.0070.00716.39
7.4.00.0030.01315.87
7.3.330.0000.00613.27
7.3.320.0030.00313.18
7.3.310.0070.00016.39
7.3.300.0000.00716.32
7.3.290.0000.00716.27
7.3.280.0030.01416.27
7.3.270.0150.00917.40
7.3.260.0130.00816.39
7.3.250.0110.00716.44
7.3.240.0130.00916.45
7.3.230.0130.00316.58
7.3.210.0060.01016.56
7.3.200.0080.00816.27
7.3.190.0030.01716.38
7.3.180.0070.01116.36
7.3.170.0110.00616.50
7.3.160.0040.01216.55
7.3.130.0100.01016.50
7.3.120.0030.01616.44
7.3.110.0000.01416.42
7.3.100.0110.00716.36
7.3.90.0080.00816.43
7.3.80.0030.01316.60
7.3.70.0060.01216.18
7.3.60.0090.00316.34
7.3.50.0070.00316.50
7.3.40.0060.00316.16
7.3.30.0060.00916.40
7.3.20.0060.00618.18
7.3.10.0060.00318.04
7.3.00.0030.00918.25
7.2.330.0060.01216.45
7.2.320.0110.01116.45
7.2.310.0060.01716.69
7.2.300.0120.01216.50
7.2.290.0040.01216.42
7.2.260.0070.01316.77
7.2.250.0040.01116.68
7.2.240.0140.00316.71
7.2.230.0030.01016.38
7.2.220.0120.00316.66
7.2.210.0030.00916.28
7.2.200.0040.01116.67
7.2.190.0060.00616.69
7.2.180.0060.00616.53
7.2.170.0000.01316.66
7.2.160.0060.00616.43
7.2.150.0030.00618.52
7.2.140.0060.00918.49
7.2.130.0070.00718.53
7.2.120.0030.01318.44
7.2.110.0060.01018.57
7.2.100.0030.01418.40
7.2.90.0070.01118.51
7.2.80.0070.01018.47
7.2.70.0090.00618.42
7.2.60.0040.00817.60
7.2.50.0060.00918.46
7.2.40.0060.00618.55
7.2.30.0040.01118.64
7.2.20.0040.00818.55
7.2.10.0090.00918.31
7.2.00.0180.00318.15
7.1.330.0080.00617.27
7.1.320.0000.01517.30
7.1.310.0090.00317.49
7.1.300.0030.00617.34
7.1.290.0080.00617.32
7.1.280.0090.00617.23
7.1.270.0030.00917.59
7.1.260.0030.01017.12
7.1.250.0040.01117.20
7.1.240.0030.01017.16
7.1.230.0030.01417.26
7.1.220.0040.01217.32
7.1.210.0130.00017.20
7.1.200.0060.00716.59
7.1.190.0040.00417.46
7.1.180.0030.01317.37
7.1.170.0090.00617.44
7.1.160.0040.00717.31
7.1.150.0040.01117.19
7.1.140.0030.00717.32
7.1.130.0070.00916.92
7.1.120.0090.00917.18
7.1.110.0060.01216.72
7.1.100.0110.00716.90
7.1.90.0430.00716.56
7.1.80.0090.00916.78
7.1.70.0110.00516.35
7.1.60.0180.00825.19
7.1.50.0140.00925.10
7.1.40.0160.00624.99
7.1.30.0150.00824.96
7.1.20.0210.00625.09
7.1.10.0140.00616.04
7.1.00.0090.00916.02
7.0.330.0120.00417.00
7.0.320.0040.01116.89
7.0.310.0040.01117.13
7.0.300.0030.01417.11
7.0.290.0000.01117.01
7.0.280.0030.00616.97
7.0.270.0040.00716.93
7.0.260.0000.01017.08
7.0.250.0000.01517.12
7.0.240.0030.01017.03
7.0.230.0060.00616.89
7.0.220.0100.00317.07
7.0.210.0080.00817.07
7.0.200.0060.00917.10
7.0.190.0060.01217.01
7.0.180.0030.01117.08
7.0.170.0000.01216.98
7.0.160.0040.01217.03
7.0.150.0030.00716.99
7.0.140.0080.00417.02
7.0.130.0110.00017.06
7.0.120.0090.00617.03
7.0.110.0040.01417.05
7.0.100.0070.00416.90
7.0.90.0080.00417.11
7.0.80.0030.00617.05
7.0.70.0080.00517.02
7.0.60.0120.00417.19
7.0.50.0070.00716.81
7.0.40.0070.00715.01
7.0.30.0060.00315.07
7.0.20.0070.01014.95
7.0.10.0030.01214.98
7.0.00.0000.01714.61
5.6.400.0090.00316.12
5.6.390.0070.00715.77
5.6.380.0060.00615.91
5.6.370.0090.00616.02
5.6.360.0110.00615.80
5.6.350.0040.01116.09
5.6.340.0040.00815.68
5.6.330.0030.00915.95
5.6.320.0060.01016.02
5.6.310.0100.00315.70
5.6.300.0110.00415.78
5.6.290.0030.01016.23
5.6.280.0030.00915.92
5.6.270.0030.01315.93
5.6.260.0040.00816.29
5.6.250.0070.00715.86
5.6.240.0090.00316.10
5.6.230.0030.00616.18
5.6.220.0110.00416.02
5.6.210.0000.01415.91
5.6.200.0070.00716.21
5.6.190.0030.01015.68
5.6.180.0090.00315.85
5.6.170.0000.01415.80
5.6.160.0070.01015.88
5.6.150.0070.01015.65
5.6.140.0000.01615.98
5.6.130.0060.01115.84
5.6.120.0030.01315.96
5.6.110.0120.00615.78
5.6.100.0040.01415.75
5.6.90.0090.00615.89
5.6.80.0030.00915.91
5.6.70.0100.00315.92
5.6.60.0030.00816.03
5.6.50.0030.01315.85
5.6.40.0100.00715.84
5.6.30.0030.00915.88
5.6.20.0130.00015.88
5.6.10.0040.01415.82
5.6.00.0090.00615.68

preferences:
54.09 ms | 400 KiB | 5 Q