3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function test(): self|string { return new \stdClass; } }; $b = new class { public function test(): self|string { return new \stdClass; } }; try { (new a)->test(); } catch (\Throwable $e) { echo $e->getMessage().PHP_EOL; } try { $b->test(); } catch (\Throwable $e) { echo $e->getMessage().PHP_EOL; }

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.4.120.0130.00720.39
8.4.110.0050.00322.80
8.4.100.0090.00718.13
8.4.90.0120.00818.73
8.4.80.0120.00718.05
8.4.70.0040.00417.86
8.4.60.0140.00619.05
8.4.50.0090.00218.82
8.4.40.0130.00617.69
8.4.30.0130.00722.19
8.4.20.0090.00618.04
8.4.10.0120.00619.50
8.3.250.0120.00618.68
8.3.240.0060.00317.17
8.3.230.0170.00316.72
8.3.220.0120.00717.10
8.3.210.0040.00518.23
8.3.200.0060.00416.51
8.3.190.0060.00317.22
8.3.180.0110.00718.59
8.3.170.0060.01217.23
8.3.160.0070.01416.81
8.3.150.0070.01118.82
8.3.140.0090.00616.61
8.3.130.0070.00316.54
8.3.120.0030.00618.88
8.3.110.0180.00720.94
8.3.100.0040.00424.06
8.3.90.0060.00326.77
8.3.80.0090.00016.75
8.3.70.0000.01416.63
8.3.60.0070.01418.55
8.3.50.0100.00824.48
8.3.40.0150.00018.84
8.3.30.0040.01118.51
8.3.20.0000.00724.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.290.0130.00520.35
8.2.280.0120.00422.31
8.2.270.0090.00917.17
8.2.260.0000.01016.59
8.2.250.0030.00618.86
8.2.240.0080.00016.96
8.2.230.0210.00022.58
8.2.220.0120.00337.54
8.2.210.0060.00326.77
8.2.200.0030.00616.63
8.2.190.0150.00016.63
8.2.180.0110.01125.92
8.2.170.0150.00018.89
8.2.160.0100.00722.96
8.2.150.0000.00725.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00721.00
8.2.110.0030.00622.25
8.2.100.0030.00720.52
8.1.330.0130.00721.97
8.1.320.0090.01016.15
8.1.310.0060.00916.60
8.1.300.0060.00320.38
8.1.290.0090.00030.84
8.1.280.0110.00425.92
8.1.270.0090.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00620.35
8.1.230.0030.01018.55
8.0.20.0080.01017.40
8.0.10.0170.00017.40
8.0.00.0120.01317.63
7.4.150.0040.01217.40
7.4.140.0140.00517.63
7.4.130.0090.01117.63
7.4.120.0130.01117.63
7.4.110.0100.01317.63
7.4.100.0090.01217.63
7.4.90.0080.01517.63
7.4.80.0170.01217.63
7.4.70.0130.01117.63
7.4.60.0120.00917.63
7.4.50.0120.01017.63
7.4.40.0150.00617.63
7.4.30.0090.01117.63
7.4.20.0130.00817.63
7.4.10.0120.01017.63
7.4.00.0170.01617.63
7.3.270.0070.01017.40
7.3.260.0120.00817.63
7.3.250.0140.00717.63
7.3.240.0070.01417.63
7.3.230.0190.00317.63
7.3.220.0140.00817.63
7.3.210.0180.00617.63
7.3.200.0200.01017.63
7.3.190.0090.01217.63
7.3.180.0120.01017.63
7.3.170.0050.01417.63
7.3.160.0120.00817.63
7.3.150.0120.00917.63
7.3.140.0140.00717.63
7.3.130.0150.00417.63
7.3.120.0100.01417.63
7.3.110.0140.00717.63
7.3.100.0080.01417.63
7.3.90.0100.01217.63
7.3.80.0140.01117.63
7.3.70.0130.01117.63
7.3.60.0160.01017.63
7.3.50.0110.01317.63
7.3.40.0130.01317.63
7.3.30.0140.00617.63
7.3.20.0130.00817.63
7.3.10.0090.01317.63
7.3.00.0140.00917.63

preferences:
60.09 ms | 403 KiB | 5 Q