3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[\Attribute(\Attribute::TARGET_PARAMETER)] class Inject { public function __construct( public readonly string $id ) { } } class MyFoo { public function __construct( #[Inject('baz-value')] public readonly int $bar, ){} } $ref = new ReflectionClass(MyFoo::class); echo "Checking Parameters : "; $parameters = $ref->getConstructor()->getParameters(); foreach ($parameters as $parameter) { foreach ($parameter->getAttributes() as $attribute) { $attribute->newInstance(); } } echo "✅\n\n"; echo "Checking Properties : "; $properties = $ref->getProperties(); foreach ($properties as $property) { foreach ($property->getAttributes() as $attribute) { $attribute->newInstance(); } } echo "✅\n\n";

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.70.0200.00918.06
8.4.60.0380.01017.69
8.4.50.0360.01117.87
8.4.40.0400.00917.51
8.4.30.0370.01217.41
8.4.20.0390.00917.62
8.4.10.0400.00917.37
8.3.210.0250.00717.61
8.3.200.0350.00916.51
8.3.190.0350.00816.73
8.3.180.0310.00716.77
8.3.170.0340.01016.71
8.3.160.0310.01016.62
8.3.150.0340.00816.69
8.3.140.0340.00716.55
8.3.130.0310.00816.66
8.3.120.0330.00716.60
8.3.110.0350.00716.69
8.3.100.0390.00916.67
8.3.90.0360.01016.57
8.3.80.0360.01016.65
8.3.70.0380.01016.67
8.3.60.0380.00816.61
8.3.50.0360.00716.81
8.3.40.0390.00917.47
8.3.30.0350.01117.57
8.3.20.0330.00917.41
8.3.10.0330.00617.60
8.3.00.0260.00817.62
8.2.280.0300.00816.57
8.2.270.0320.00916.59
8.2.260.0270.00816.56
8.2.250.0240.00516.58
8.2.240.0250.00716.68
8.2.230.0290.01016.61
8.2.220.0320.00916.76
8.2.210.0290.01016.52
8.2.200.0330.00816.46
8.2.190.0290.01016.46
8.2.180.0300.00916.60
8.2.170.0330.00817.79
8.2.160.0310.00917.60
8.2.150.0330.00817.57
8.2.140.0350.00717.46
8.2.130.0360.00717.42
8.2.120.0350.00717.54
8.2.110.0330.00917.66
8.2.100.0310.01017.60
8.2.90.0350.00717.59
8.2.80.0270.00917.68
8.2.70.0270.00717.63
8.2.60.0310.00617.56
8.2.50.0300.00817.56
8.2.40.0330.01017.61
8.2.30.0320.00917.59
8.2.20.0320.00717.57
8.2.10.0290.00817.52
8.2.00.0280.01017.45

preferences:
27.88 ms | 403 KiB | 5 Q