Re:An Exceptional Change in PHP 7.0
by ufo on Monday October 05, 2015 @08:22PM
(#10335986)
I still don't get what stopped them from using any of the existing operators.
[ Parent
| on HN ]
Rationale was discussed on IRC, see:
https://wiki.php.net/_media/rfc/php.ns.txt
Linked to at the bottom of:
I skimmed through it but couldn't really understand why they couldn't coopt one of the existing operators (for example, by making classes have a namespace for their methods)
Couldn't they provide a clearer explanation than simply dumping a huge IRC log like that??
Basically namespaces operate at a different level. You can almost imagine it like Macro expansion -- the namespaces are fully resolved for all the symbols in the file and then the compilation happens. This is necessary for a host of reasons. They can't co-opt an existing operator because all the existing operators work at an entirely different level.