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.0080.00818.31
8.3.50.0120.00618.16
8.3.40.0090.00618.93
8.3.30.0080.00818.88
8.3.20.0070.00020.29
8.3.10.0080.00021.85
8.3.00.0070.00319.45
8.2.180.0090.00916.63
8.2.170.0130.00322.96
8.2.160.0030.01020.47
8.2.150.0050.00224.18
8.2.140.0050.00324.66
8.2.130.0060.00322.26
8.2.120.0080.00026.35
8.2.110.0090.00020.93
8.2.100.0080.00417.78
8.2.90.0050.00319.26
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0000.00817.92
8.2.50.0040.00418.10
8.2.40.0000.00920.38
8.2.30.0040.00419.13
8.2.20.0000.00818.11
8.2.10.0040.00418.12
8.2.00.0000.00718.25
8.1.280.0090.01225.92
8.1.270.0040.00420.25
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00022.75
8.1.230.0110.00017.64
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0000.00917.35
8.1.180.0080.00018.10
8.1.170.0030.00518.59
8.1.160.0040.00418.91
8.1.150.0000.00718.82
8.1.140.0000.00817.70
8.1.130.0070.00019.01
8.1.120.0050.00217.40
8.1.110.0040.00417.49
8.1.100.0030.00717.52
8.1.90.0000.00717.50
8.1.80.0000.01017.49
8.1.70.0000.00717.48
8.1.60.0060.00317.57
8.1.50.0000.00917.58
8.1.40.0040.00417.46
8.1.30.0050.00317.64
8.1.20.0000.00817.62
8.1.10.0040.00417.61
8.1.00.0050.00317.41
8.0.300.0080.00018.77
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0000.00817.29
8.0.260.0030.00318.52
8.0.250.0030.00317.07
8.0.240.0050.00217.07
8.0.230.0040.00417.04
8.0.220.0030.00316.90
8.0.210.0030.00316.97
8.0.200.0040.00416.94
8.0.190.0000.00817.02
8.0.180.0000.00717.03
8.0.170.0060.00316.96
8.0.160.0000.00717.02
8.0.150.0080.00016.92
8.0.140.0060.00316.97
8.0.130.0060.00013.41
8.0.120.0030.00516.77
8.0.110.0070.00016.85
8.0.100.0000.00716.79
8.0.90.0050.00216.85
8.0.80.0090.00616.93
8.0.70.0000.00716.78
8.0.60.0050.00216.98
8.0.50.0040.00416.91
8.0.30.0100.01017.02
8.0.20.0110.00917.40
8.0.10.0040.00417.18
8.0.00.0080.00916.60
7.4.330.0050.00015.55
7.4.320.0070.00016.66
7.4.300.0000.00616.65
7.4.290.0040.00416.63
7.4.280.0040.00416.41
7.4.270.0080.00016.51
7.4.260.0000.00716.52
7.4.250.0030.00516.47
7.4.240.0030.00316.38
7.4.230.0030.00316.61
7.4.220.0060.00316.60
7.4.210.0080.01116.62
7.4.200.0000.00716.64
7.4.160.0080.00816.54
7.4.150.0080.01117.40
7.4.140.0150.00417.86
7.4.130.0070.01016.53
7.4.120.0100.01116.59
7.4.110.0070.01016.63
7.4.100.0060.01016.60
7.4.90.0140.00416.57
7.4.80.0120.00619.39
7.4.70.0130.01116.70
7.4.60.0110.00416.32
7.4.50.0050.00816.28
7.4.40.0100.00716.64
7.4.00.0100.00614.76
7.3.330.0000.00613.43
7.3.320.0000.00513.37
7.3.310.0000.00816.32
7.3.300.0040.00416.37
7.3.290.0030.00316.39
7.3.280.0140.00316.41
7.3.270.0100.00717.40
7.3.260.0140.00616.33
7.3.250.0080.01116.41
7.3.240.0120.00816.38
7.3.230.0100.00716.47
7.3.210.0030.01316.33
7.3.200.0120.00616.56
7.3.190.0070.01016.38
7.3.180.0070.01016.43
7.3.170.0130.00316.47
7.3.160.0120.00316.50
7.3.10.0100.00316.71
7.3.00.0000.01116.90
7.2.330.0070.01316.59
7.2.320.0120.00616.77
7.2.310.0110.01116.75
7.2.300.0090.00916.87
7.2.290.0100.00716.61
7.2.130.0070.00717.00
7.2.120.0000.01617.17
7.2.110.0040.00917.20
7.2.100.0060.00916.90
7.2.90.0060.00316.68
7.2.80.0110.00416.94
7.2.70.0030.01016.90
7.2.60.0060.01116.98
7.2.50.0040.01216.88
7.2.40.0070.00716.94
7.2.30.0070.00717.17
7.2.20.0110.00617.09
7.2.10.0360.00917.55
7.2.00.0140.01217.63
7.1.250.0100.00715.86
7.1.200.0060.00315.88
7.1.130.0180.00816.87
7.1.120.0230.01416.83
7.1.110.0160.01016.12
7.1.100.0180.01015.92
7.1.90.0230.01016.10
7.1.80.0210.00616.04
7.1.70.0210.00515.32
7.1.60.0240.01632.93
7.1.50.0320.01032.91
7.1.40.0360.01132.42
7.1.30.0300.01432.63
7.1.20.0320.01532.66
7.1.10.0260.00614.81
7.1.00.0240.00914.91

preferences:
50.44 ms | 400 KiB | 5 Q