Using new keyword in attribute Follow
If i use new keyword in any attribute the IDE says: "Constant expression contains invalid operations"
Example:
============================
#[MyAttr(arg1: new MyModel())]
class Test { /* ... */ }
============================
Above code is working with php 8.1.0RC1
So i think this is the IDE fault !!
(My PhpStorm version: 2021.2.2)
Please sign in to leave a comment.
This will be supported starting IDE version 2021.3: https://youtrack.jetbrains.com/issue/WI-62095.