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.0080.00818.81
8.3.50.0000.01418.18
8.3.40.0070.01418.83
8.3.30.0100.00718.79
8.3.20.0080.00020.25
8.3.10.0080.00021.97
8.3.00.0040.00419.22
8.2.180.0070.01418.48
8.2.170.0040.01122.96
8.2.160.0100.00320.10
8.2.150.0030.00525.66
8.2.140.0040.00424.66
8.2.130.0080.00022.11
8.2.120.0040.00426.35
8.2.110.0110.00719.45
8.2.100.0100.00717.64
8.2.90.0030.00619.22
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0040.00418.03
8.2.50.0040.00418.22
8.2.40.0040.00420.45
8.2.30.0000.00719.32
8.2.20.0080.00017.96
8.2.10.0070.00017.94
8.2.00.0040.00418.15
8.1.280.0100.01025.92
8.1.270.0080.00020.27
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0130.00722.37
8.1.230.0040.00717.83
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0030.00617.23
8.1.190.0060.00317.23
8.1.180.0000.00818.10
8.1.170.0070.00018.66
8.1.160.0000.00818.89
8.1.150.0040.00418.90
8.1.140.0000.00817.76
8.1.130.0040.00420.78
8.1.120.0030.00317.49
8.1.110.0000.00817.50
8.1.100.0030.00617.42
8.1.90.0040.00417.35
8.1.80.0100.00017.29
8.1.70.0040.00417.48
8.1.60.0000.00817.51
8.1.50.0040.00417.41
8.1.40.0000.00817.56
8.1.30.0040.00417.57
8.1.20.0040.00417.48
8.1.10.0030.00617.64
8.1.00.0030.00617.58
8.0.300.0040.00418.77
8.0.290.0000.00916.88
8.0.280.0000.00818.45
8.0.270.0040.00417.13
8.0.260.0030.00318.51
8.0.250.0000.00717.02
8.0.240.0030.00316.93
8.0.230.0070.00017.02
8.0.220.0080.00016.93
8.0.210.0020.00516.95
8.0.200.0000.00617.04
8.0.190.0000.00816.89
8.0.180.0000.00717.00
8.0.170.0030.00616.96
8.0.160.0000.00717.01
8.0.150.0040.00416.89
8.0.140.0000.00716.89
8.0.130.0050.00513.37
8.0.120.0090.00016.91
8.0.110.0000.00717.00
8.0.100.0000.00716.98
8.0.90.0050.00316.82
8.0.80.0030.01317.00
8.0.70.0050.00316.84
8.0.60.0030.00516.85
8.0.50.0080.00016.99
8.0.30.0070.01017.01
8.0.20.0150.00517.40
8.0.10.0020.00517.05
8.0.00.0080.01016.71
7.4.330.0000.00415.55
7.4.320.0000.00716.53
7.4.300.0030.00316.40
7.4.290.0030.00316.48
7.4.280.0000.00716.59
7.4.270.0050.00316.65
7.4.260.0030.00316.39
7.4.250.0030.00516.47
7.4.240.0030.00316.52
7.4.230.0000.00716.48
7.4.220.0030.00616.58
7.4.210.0060.00916.70
7.4.200.0080.00016.66
7.4.160.0050.01216.55
7.4.150.0180.00617.40
7.4.140.0110.00917.86
7.4.130.0110.00516.68
7.4.120.0090.00916.49
7.4.110.0030.01516.52
7.4.100.0080.00816.59
7.4.90.0180.00316.43
7.4.80.0090.01219.39
7.4.70.0130.00916.48
7.4.60.0030.01316.43
7.4.50.0060.00916.79
7.4.40.0100.01316.46
7.4.00.0050.01214.82
7.3.330.0030.00313.29
7.3.320.0060.00013.23
7.3.310.0080.00016.40
7.3.300.0070.00016.37
7.3.290.0100.00716.36
7.3.280.0100.01016.37
7.3.270.0110.00717.40
7.3.260.0110.01016.44
7.3.250.0140.00616.46
7.3.240.0140.00816.55
7.3.230.0080.00816.52
7.3.210.0100.00716.52
7.3.200.0080.00816.32
7.3.190.0070.01316.35
7.3.180.0060.01216.43
7.3.170.0070.00916.43
7.3.160.0080.00816.45
7.3.120.0100.00614.94
7.3.110.0030.00914.84
7.3.100.0060.00914.80
7.3.90.0070.01014.69
7.3.80.0100.00315.01
7.3.70.0100.00714.90
7.3.60.0070.00414.96
7.3.50.0080.00414.40
7.3.40.0060.00314.87
7.3.30.0030.01014.76
7.3.20.0030.01416.68
7.3.10.0070.00716.64
7.3.00.0000.01216.54
7.2.330.0070.01116.75
7.2.320.0070.01016.79
7.2.310.0070.01016.84
7.2.300.0190.00416.74
7.2.290.0060.01916.82
7.2.250.0070.01515.22
7.2.240.0090.00915.24
7.2.230.0000.01014.96
7.2.220.0030.01314.84
7.2.210.0110.00314.68
7.2.200.0070.01014.88
7.2.190.0060.00615.01
7.2.180.0060.00914.98
7.2.170.0090.00614.72
7.2.60.0030.01017.07
7.2.10.0000.01417.82
7.2.00.0290.01118.09
7.1.330.0110.00315.75
7.1.320.0030.01015.54
7.1.310.0070.00315.71
7.1.300.0090.00615.79
7.1.290.0070.00715.55
7.1.280.0070.00715.82
7.1.270.0000.01715.54
7.1.260.0000.01416.00
7.1.200.0030.00615.88
7.1.130.0050.00816.61
7.1.120.0290.01016.46
7.1.110.0300.01315.96
7.1.100.0340.01016.02
7.1.90.0400.00616.25
7.1.80.0350.00616.37
7.1.70.0280.01415.35
7.1.60.0140.01433.25
7.1.50.0400.01432.95
7.1.40.0420.01232.46
7.1.30.0490.00932.67
7.1.20.0350.01832.71
7.1.10.0290.01014.67
7.1.00.0380.00714.75

preferences:
46.05 ms | 400 KiB | 5 Q