3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[AsCommand(description: 'description of the command', name: 'app:'.self::COMMAND.':process')] final class MyCommand { private const COMMAND = 'command'; } $r = new ReflectionClass('MyCommand'); foreach($r->getAttributes() as $attribute) { foreach($attribute->getArguments() as $arg) { var_dump($arg); } }
Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.23, 8.3.0 - 8.3.11
string(26) "description of the command" string(19) "app:command:process"

preferences:
42.85 ms | 406 KiB | 5 Q