On 27/06/2020 10:56, Andrea Faulds wrote:
Of course, if T_PAAMAYIM_NEKUDOTAYIM was never encountered by userland developers, this RFC wouldn't exist. The thing is, I don't think T_DOUBLE_COLON should be encountered by userland developers either — in my view, as an implementation detail, token names shouldn't be part of parser error messages at all. If we were to remove token names from the parser errors, we would avoid the problem this RFC seeks to solve. For most tokens we could simply display the characters it corresponds to (e.g. "::" for T_PAAMAYIM_NEKUDOTAYIM, which we already do!), and for those with variable content (e.g. T_STRING) we could display a human-readable description of what is expected (e.g. "an identifier").
Just to confirm, I am actively working on exactly this, and although slightly delayed by an outbreak of sunny weather, fully expect to have a patch (and, if deemed necessary, RFC) in plenty of time for 8.0.
I intend to post a new thread with examples of old and new messages once I've finalised the details.
Regards, -- Rowan Tommins (né Collins) [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php