Closed
Description
Description
The following code (https://3v4l.org/oMXAL)
<?php
class Demo {
private (set) mixed $v1;
}
Resulted in this output:
Parse error: syntax error, unexpected token ")", expecting amp in /in/oMXAL on line 4
But I expected this output instead:
Parse error: syntax error, unexpected token ")", expecting ampersand in /in/oMXAL on line 4
(or expecting "&"
)
Alternatively, for the limited case of wrong asymmetric visibility specification (there shouldn't be a space in private(set)
) maybe mention that? But for things other than (set)
the amp
is still a bit confusing
PHP Version
8.3+
Operating System
No response