Introduce syntax allowing symbol names to use reserved and semi-reserved ways with no risk of getting reserved in future PHP versions.
Reserved words being keywords in parser context cannot be used as symbol names, for eg. class/interface/trait/enum/function/const declarations. As PHP evolves more keywords are introduced and more words are forbidden to use in described symbol names. A new syntax fully BC would allow these words to be still used or just used by adding “\” prefix in front of a keyword name.
This allows smoother migration of old code that for eg. uses “match” as a function name, as this has become a reserved word in recent PHP versions. There are and possibly will be new RFCs that may introduce more reserved words as new keywords, like the use of “is” in pattern matching, etc.
This proposal's aim is to secure code maintained currently which may be broken in the future because of reserving more words and allow smooth migration path by just adding “\” in front of symbol names which might be automated to some degree.
None.
8.2
None.
None.
Unverified.
Language change requires 2/3.
TBD