3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[\Attribute] class AttribWithName { public readonly string $name; public function __construct(?string $name = null) { if ($name) { $this->name = $name; } } public function fromReflection(\ReflectionClass $subject): void { $this->name ??= $subject->getShortName(); } } #[AttribWithName()] class C {} $attr = (new ReflectionClass(C::class))->getAttributes()[0]->newInstance(); print "Ok up to here.\n"; // And now the fatal. print $attr->name;

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.00424.05
8.4.110.0080.00418.67
8.4.100.0030.00517.99
8.4.90.0150.00520.50
8.4.80.0050.00318.12
8.4.70.0080.01117.93
8.4.60.0090.00219.00
8.4.50.0100.01017.94
8.4.40.0130.00620.74
8.4.30.0090.00922.32
8.4.20.0110.01117.96
8.4.10.0000.00823.82
8.3.250.0140.00618.95
8.3.240.0120.00817.00
8.3.230.0120.00516.56
8.3.220.0100.00818.57
8.3.210.0120.00816.92
8.3.200.0060.00316.68
8.3.190.0050.00417.23
8.3.180.0110.00716.38
8.3.170.0140.00418.88
8.3.160.0000.00816.57
8.3.150.0130.00617.41
8.3.140.0000.00816.97
8.3.130.0100.00016.73
8.3.120.0090.00018.95
8.3.110.0080.00020.94
8.3.100.0050.00316.78
8.3.90.0030.00716.60
8.3.50.0040.00416.63
8.2.290.0100.00920.54
8.2.280.0080.00918.47
8.2.270.0140.00417.16
8.2.260.0030.00620.74
8.2.250.0060.00918.54
8.2.240.0000.00819.14
8.2.230.0080.00022.58
8.2.220.0060.00316.98
8.2.210.0090.00016.57
8.2.60.0180.00317.44
8.2.50.0120.00817.38
8.2.40.0130.00317.56
8.2.30.0120.00517.50
8.2.20.0090.00417.69
8.2.10.0090.00717.50
8.2.00.0140.00217.37
8.1.330.0130.00622.01
8.1.320.0060.00416.23
8.1.310.0030.01516.82
8.1.300.0120.00617.74
8.1.190.0050.01217.06
8.1.180.0030.01516.97
8.1.170.0160.00017.19
8.1.160.0130.00417.17
8.1.150.0100.00717.00
8.1.140.0120.00516.94
8.1.130.0070.00917.18
8.1.120.0110.00617.06
8.1.110.0150.00217.25
8.1.100.0060.01017.06
8.1.90.0120.00517.06
8.1.80.0110.00517.19
8.1.70.0130.00317.34
8.1.60.0110.00817.31
8.1.50.0160.00217.30
8.1.40.0110.00717.29
8.1.30.0110.00717.31
8.1.20.0150.00317.38
8.1.10.0170.00017.19
8.1.00.0150.00317.24
8.0.280.0100.00416.52
8.0.270.0120.00416.52
8.0.260.0120.00416.63
8.0.250.0120.00416.52
8.0.240.0170.00016.52
8.0.230.0090.00716.52
8.0.220.0100.00516.52
8.0.210.0080.00816.57
8.0.200.0110.00516.69
8.0.190.0110.00416.52
8.0.180.0160.00016.52
8.0.170.0120.00416.61
8.0.160.0130.00316.69
8.0.150.0110.00516.57
8.0.140.0150.00116.52
8.0.130.0100.00516.52
8.0.120.0100.00616.63
8.0.110.0110.00416.63
8.0.100.0090.00616.57
8.0.90.0100.00516.57
8.0.80.0120.00316.52
8.0.70.0150.00116.52
8.0.60.0120.00116.90
8.0.50.0060.00916.63
8.0.30.0130.00516.52
8.0.20.0120.00416.52
8.0.10.0160.00216.57

preferences:
25.87 ms | 403 KiB | 5 Q