3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[Attribute(Attribute::TARGET_CLASS_CONSTANT)] class TestAttribute { public function __construct(public string $value) { } } enum TestNum { #[TestAttribute('alpha value')] case ALPHA; #[TestAttribute('beta value')] case BETA; } $obj = TestNum::ALPHA; var_dump((new \ReflectionClassConstant($obj::class, $obj->name))->getAttributes(TestAttribute::class)[0]->newInstance());

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.5.00.0130.00820.27
8.4.150.0030.00014.05
8.4.140.0120.01017.65
8.4.130.0030.00617.87
8.4.120.0120.00920.64
8.4.110.0120.00722.33
8.4.100.0060.00417.84
8.4.90.0150.00718.60
8.4.80.0120.00817.89
8.4.70.0090.01117.79
8.4.60.0130.00818.96
8.4.50.0130.00920.35
8.4.40.0030.00617.85
8.4.30.0040.00420.46
8.4.20.0130.00719.43
8.4.10.0070.00319.43
8.3.280.0130.00720.19
8.3.270.0110.01416.74
8.3.260.0120.00616.57
8.3.250.0090.00918.70
8.3.240.0050.00516.47
8.3.230.0030.00616.61
8.3.220.0100.00916.62
8.3.210.0070.00116.76
8.3.200.0070.00418.37
8.3.190.0120.00716.91
8.3.180.0080.01016.54
8.3.170.0130.00617.22
8.3.160.0170.00316.52
8.3.150.0070.01118.53
8.3.140.0090.00916.61
8.3.130.0030.00618.49
8.3.120.0100.00018.87
8.3.110.0040.00422.58
8.3.100.0000.00822.58
8.3.90.0100.01022.58
8.3.50.0100.00022.58
8.2.290.0080.01020.25
8.2.280.0110.00818.12
8.2.270.0060.00317.18
8.2.260.0050.00319.01
8.2.250.0030.00617.09
8.2.240.0000.00817.32
8.2.230.0040.00422.58
8.2.220.0090.00022.58
8.2.210.0040.00422.58
8.1.330.0030.00520.22
8.1.320.0080.01215.84
8.1.310.0040.00418.57
8.1.300.0040.01517.63
8.1.20.0070.00617.61
8.1.10.0100.00917.51
8.1.00.0090.00517.38
8.0.150.0040.00916.73
8.0.140.0070.00716.68
8.0.130.0030.01116.73
8.0.120.0100.00716.74
8.0.110.0070.00716.81
8.0.100.0060.01016.69
8.0.90.0140.00216.71
8.0.80.0000.01216.89
8.0.70.0080.00816.65
8.0.60.0120.00316.80
8.0.50.0100.00616.77
8.0.30.0130.00716.88
8.0.20.0120.00616.80
8.0.10.0110.00316.84
7.4.270.0130.00516.32
7.4.260.0060.00616.45
7.4.250.0170.00016.43
7.4.240.0160.00416.45
7.4.230.0090.00616.19
7.4.220.0170.00016.39
7.4.210.0130.00616.38
7.4.200.0150.00416.43
7.4.190.0200.00016.54
7.4.180.0060.00316.42
7.4.160.0190.00016.39
7.4.150.0150.00816.39
7.4.140.0170.00416.31
7.4.130.0160.00416.11
7.4.120.0200.00016.23
7.4.110.0180.00316.20
7.4.100.0170.00416.37
7.4.90.0130.00616.15
7.4.80.0150.00616.23
7.4.70.0130.01016.15
7.4.60.0150.00716.16
7.4.50.0150.00816.04
7.4.40.0140.00616.12
7.4.30.0130.00716.22
7.4.20.0190.00016.09
7.4.10.0130.00316.17
7.4.00.0130.00016.03

preferences:
36.93 ms | 403 KiB | 5 Q