Using new keyword in attribute

If i use new keyword in any attribute the IDE says: "Constant expression contains invalid operations"



#[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)


1 comment
Comment actions Permalink

This will be supported starting IDE version 2021.3:


Please sign in to leave a comment.