3 ms·
Can you have a namespace with the same name as a local variable? If not, then they could have used `/`. Of course then you cannot know what an expression means
by captainmuon 5y ago
Can you have a namespace with the same name as a local variable? If not, then they could have used `/`. Of course then you cannot know what an expression means without executing the program, but I'd assume they already have a few cases in there (with variable variables and so on; it's bin a while since I've used PHP productively).
It would also have been possible to just reuse `->`, then namespaces look a lot like static objects. Or the double colon `::` which was already used in some contexts.
- tored 5y agoPHP 8 changed how the parsing of namespaces work, instead of multiple tokens it is just one. https://wiki.php.net/rfc/namespaced_names_as_token https://wiki.php.net/rfc/namespaced_names_as_token I wonder with this change it would be theoretically possible to have any character as a namespace separator.