3v4l.org

run code in 300+ PHP versions simultaneously
<?php #[AsCommand(description: 'description of the command', name: 'app:'.self::command.':process')] final class MyCommand { } $r = new ReflectionClass('MyCommand'); foreach($r->getAttributes() as $attribute) { foreach($attribute->getArguments() as $arg) { var_dump($arg); } }
Output for 8.3.0 - 8.3.11
Fatal error: Uncaught Error: Undefined constant self::command in /in/p9206:3 Stack trace: #0 /in/p9206(10): [constant expression]() #1 /in/p9206(10): ReflectionAttribute->getArguments() #2 {main} thrown in /in/p9206 on line 3
Process exited with code 255.
Output for 8.2.0 - 8.2.23
Fatal error: Uncaught Error: Undefined constant self::command in /in/p9206:3 Stack trace: #0 /in/p9206(10): ReflectionAttribute->getArguments() #1 {main} thrown in /in/p9206 on line 3
Process exited with code 255.
Output for 8.1.0 - 8.1.29
Fatal error: Uncaught Error: Undefined constant self::command in /in/p9206:10 Stack trace: #0 /in/p9206(10): ReflectionAttribute->getArguments() #1 {main} thrown in /in/p9206 on line 10
Process exited with code 255.

preferences:
50.17 ms | 408 KiB | 5 Q