1--TEST--
2Nullsafe property constant expression rhs wrong type
3--FILE--
4<?php
5
6class A {}
7class B {}
8
9const A_prop = (new A)?->{new B};
10
11var_dump(A_prop);
12
13?>
14--EXPECTF--
15Fatal error: Uncaught Error: Object of class B could not be converted to string in %s:%d
16Stack trace:
17#0 {main}
18  thrown in %s on line %d
19