3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tr { public $s; public static $xx; /** * 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) { $tr::$xx = $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.0120.00318.48
8.3.50.0120.00318.31
8.3.40.0040.01218.97
8.3.30.0110.00418.62
8.3.20.0070.00020.20
8.3.10.0090.00021.85
8.3.00.0070.00319.50
8.2.180.0100.00716.63
8.2.170.0090.00922.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00422.25
8.2.120.0040.00426.35
8.2.110.0030.00621.03
8.2.100.0040.00817.84
8.2.90.0040.00419.06
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0040.00417.93
8.2.50.0030.00618.16
8.2.40.0000.00820.48
8.2.30.0050.00219.32
8.2.20.0040.00418.05
8.2.10.0000.00718.07
8.2.00.0030.00318.19
8.1.280.0070.01725.92
8.1.270.0000.00820.37
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00322.62
8.1.230.0070.00417.70
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.47
8.1.190.0000.00917.23
8.1.180.0040.00418.10
8.1.170.0080.00018.49
8.1.160.0000.00718.95
8.1.150.0000.00819.01
8.1.140.0030.00517.59
8.1.130.0000.00719.06
8.1.120.0000.00717.38
8.1.110.0040.00417.36
8.1.100.0000.00717.42
8.1.90.0000.00817.53
8.1.80.0100.00017.43
8.1.70.0070.00017.45
8.1.60.0000.00817.61
8.1.50.0000.00817.42
8.1.40.0030.00617.52
8.1.30.0030.00517.68
8.1.20.0000.00817.70
8.1.10.0050.00317.60
8.1.00.0040.00417.38
8.0.300.0000.00718.77
8.0.290.0080.00016.88
8.0.280.0000.00718.38
8.0.270.0000.00717.31
8.0.260.0000.00718.52
8.0.250.0000.00716.98
8.0.240.0000.00717.04
8.0.230.0000.00716.91
8.0.220.0000.00716.98
8.0.210.0030.00316.90
8.0.200.0040.00417.02
8.0.190.0000.00816.98
8.0.180.0040.00416.94
8.0.170.0060.00317.02
8.0.160.0000.00716.92
8.0.150.0070.00416.96
8.0.140.0000.00816.94
8.0.130.0030.00613.39
8.0.120.0050.00316.96
8.0.110.0030.00316.94
8.0.100.0000.00716.79
8.0.90.0040.00416.88
8.0.80.0100.00716.89
8.0.70.0000.00716.82
8.0.60.0040.00416.93
8.0.50.0030.00516.76
8.0.30.0100.00817.06
8.0.20.0100.00917.40
8.0.10.0070.00016.92
8.0.00.0120.00616.88
7.4.330.0000.00415.55
7.4.320.0000.00616.60
7.4.300.0060.00016.63
7.4.290.0030.00316.52
7.4.280.0000.00816.50
7.4.270.0040.00416.60
7.4.260.0000.00716.59
7.4.250.0080.00016.48
7.4.240.0040.00416.60
7.4.230.0050.00216.54
7.4.220.0040.00416.35
7.4.210.0080.00916.52
7.4.200.0000.00716.72
7.4.160.0090.01116.50
7.4.150.0100.00717.40
7.4.140.0110.00917.86
7.4.130.0130.00916.52
7.4.120.0120.00816.55
7.4.110.0070.01016.29
7.4.100.0060.01016.49
7.4.90.0100.00716.53
7.4.80.0080.01219.39
7.4.70.0090.01216.62
7.4.60.0000.01616.45
7.4.50.0130.00316.54
7.4.40.0150.00916.58
7.4.10.0130.00816.43
7.4.00.0070.01116.11
7.3.330.0050.00013.45
7.3.320.0000.00613.41
7.3.310.0000.00716.52
7.3.300.0030.00316.27
7.3.290.0030.00316.43
7.3.280.0100.01016.43
7.3.270.0150.00417.40
7.3.260.0130.00716.39
7.3.250.0100.00716.46
7.3.240.0150.00616.42
7.3.230.0070.01016.33
7.3.210.0070.01016.57
7.3.200.0090.00616.62
7.3.190.0130.01016.59
7.3.180.0040.01216.38
7.3.170.0030.01216.51
7.3.160.0180.02816.38
7.3.130.0050.01316.40
7.3.120.0060.01316.39
7.3.110.0090.00616.33
7.3.100.0070.00916.43
7.3.90.0100.00716.38
7.3.80.0050.00716.46
7.3.70.0040.01216.50
7.3.60.0080.00916.34
7.3.50.0080.00716.41
7.3.40.0080.00716.46
7.3.30.0050.00816.42
7.3.20.0060.01018.19
7.3.10.0080.00918.18
7.3.00.0110.00318.13
7.2.330.0100.00716.42
7.2.320.0120.00916.77
7.2.310.0140.00416.79
7.2.300.0100.01316.71
7.2.290.0040.01216.39
7.2.260.0070.01216.63
7.2.250.0100.00916.78
7.2.240.0090.00616.73
7.2.230.0060.00616.74
7.2.220.0100.00816.64
7.2.210.0080.00816.58
7.2.200.0030.01316.52
7.2.190.0050.00916.65
7.2.180.0030.01216.59
7.2.170.0080.00716.63
7.2.160.0100.00816.45
7.2.150.0080.01018.46
7.2.140.0050.01018.35
7.2.130.0070.00618.52
7.2.120.0040.01118.47
7.2.110.0150.00817.71
7.2.100.0050.00618.51
7.2.90.0080.00518.43
7.2.80.0080.00618.30
7.2.70.0040.00818.30
7.2.60.0050.01017.78
7.2.50.0060.00718.39
7.2.40.0090.00318.33
7.2.30.0100.00318.54
7.2.20.0050.01018.50
7.2.10.0140.00818.38
7.2.00.0090.01018.25
7.1.330.0100.00617.52
7.1.320.0050.01017.33
7.1.310.0080.00617.37
7.1.300.0030.00917.48
7.1.290.0050.00817.33
7.1.280.0020.01017.23
7.1.270.0120.00617.41
7.1.260.0040.01117.24
7.1.250.0040.00817.20
7.1.240.0020.01217.24
7.1.230.0080.00417.34
7.1.220.0050.00617.20
7.1.210.0070.00517.31
7.1.200.0090.00516.83
7.1.190.0060.01117.32
7.1.180.0030.00817.35
7.1.170.0020.00917.18
7.1.160.0030.01017.28
7.1.150.0030.00717.35
7.1.140.0080.00717.34
7.1.130.0100.00517.15
7.1.120.0130.00917.22
7.1.110.0110.00917.05
7.1.100.0130.00617.06
7.1.90.0100.00816.92
7.1.80.0190.00517.07
7.1.70.0120.00816.59
7.1.60.0120.01122.61
7.1.50.0220.00822.60
7.1.40.0190.00722.60
7.1.30.0140.00822.60
7.1.20.0130.01122.62
7.1.10.0110.00816.43
7.1.00.0090.01016.51
7.0.330.0070.00717.09
7.0.320.0030.00917.04
7.0.310.0020.01117.07
7.0.300.0060.00617.04
7.0.290.0060.00617.02
7.0.280.0050.00516.99
7.0.270.0050.00516.91
7.0.260.0030.01016.99
7.0.250.0030.00717.13
7.0.240.0050.00917.15
7.0.230.0040.01117.15
7.0.220.0070.00817.21
7.0.210.0050.01017.05
7.0.200.0080.00417.09
7.0.190.0040.00917.14
7.0.180.0020.01016.98
7.0.170.0030.00817.06
7.0.160.0050.00717.11
7.0.150.0050.00517.03
7.0.140.0030.00816.97
7.0.130.0030.01017.17
7.0.120.0060.00517.19
7.0.110.0020.01217.01
7.0.100.0080.00716.99
7.0.90.0060.00616.96
7.0.80.0050.00717.11
7.0.70.0080.00717.05
7.0.60.0060.00817.04
7.0.50.0050.00817.07
7.0.40.0030.01015.06
7.0.30.0020.01014.95
7.0.20.0050.01015.01
7.0.10.0080.00514.96
7.0.00.0060.00915.00
5.6.400.0120.00216.07
5.6.390.0040.01215.77
5.6.380.0060.00816.19
5.6.370.0060.00716.10
5.6.360.0050.00715.98
5.6.350.0070.00615.88
5.6.340.0110.00315.92
5.6.330.0050.00816.12
5.6.320.0010.01115.83
5.6.310.0100.00515.93
5.6.300.0040.00915.92
5.6.290.0020.01016.03
5.6.280.0050.00716.25
5.6.270.0020.01416.11
5.6.260.0040.01415.87
5.6.250.0070.01115.85
5.6.240.0030.01015.94
5.6.230.0040.00915.97
5.6.220.0040.01015.93
5.6.210.0070.00716.09
5.6.200.0100.00515.92
5.6.190.0070.00515.77
5.6.180.0060.00615.80
5.6.170.0050.01116.07
5.6.160.0090.00615.90
5.6.150.0050.01115.98
5.6.140.0090.00515.88
5.6.130.0090.00716.04
5.6.120.0020.01116.14
5.6.110.0050.01215.91
5.6.100.0020.01616.05
5.6.90.0080.01015.96
5.6.80.0070.00715.96
5.6.70.0060.01015.98
5.6.60.0050.00715.74
5.6.50.0030.00915.77
5.6.40.0070.01015.99
5.6.30.0090.00515.91
5.6.20.0070.00715.86
5.6.10.0050.00916.03
5.6.00.0070.00715.95

preferences:
69.08 ms | 400 KiB | 5 Q