You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal error: Uncaught AssertionError: assert(false && new class(true) {
public function __construct(bool $boolVal) {
}
}) in /in/rM9Hi:3
Stack trace:
#0 /in/rM9Hi(3): assert(false, 'assert(false &&...')
#1 {main}
thrown in /in/rM9Hi on line 3
But I expected this output instead (note the public in the constructor property)
Fatal error: Uncaught AssertionError: assert(false && new class(true) {
public function __construct(public bool $boolVal) {
}
}) in /in/rM9Hi:3
Stack trace:
#0 /in/rM9Hi(3): assert(false, 'assert(false &&...')
#1 {main}
thrown in /in/rM9Hi on line 3
Yeah this is definitely a bug, likely overlooked because anonymous classes are the only way you can print a function that has a promoted property as argument.
Description
The following code:
Resulted in this output:
But I expected this output instead (note the
public
in the constructor property)See https://3v4l.org/rM9Hi
PHP Version
PHP 8.2+
Operating System
No response
The text was updated successfully, but these errors were encountered: