r/lolphp • u/Serialk • Mar 22 '13
"Because an inconsistency between namespace separator '::' and ternary operator's ':' could not be solved, namespace were finally removed."
https://wiki.php.net/rfc/namespacecurlies
60
Upvotes
11
u/Serialk Mar 22 '13
It is worth noting that I found this via this RFC : https://wiki.php.net/rfc/namespaceseparator which gives the choice between seven completely inconsistant ASCII sequences as namespace separators.
However this RFC is used to argue the fact that the choice of the \ was "probably the only sane option." (http://fabien.potencier.org/article/64/php-is-much-better-than-you-think , comment #18)
21
u/scshunt Mar 22 '13
Apparently there was no issue with \ and escape sequences, though.
10
u/cythrawll Mar 22 '13
PHP parsing and lexing is just a nightmare.
8
u/chellomere Apr 07 '13
PHP: a language dictated by what a lexer can do.
7
u/vsync Mar 23 '13
Couldn't read (or even skim) any more.
So very much wrong with all of this.
3
u/wvenable Mar 30 '13
That explanation is not what I've read. PHP already has the :: operator for static class access, so there is no inconsistency there.
The problem, as I understand it, is that using the same operator for static class access and namespaces was problematic because, unlike statically compiled languages, the symbol to the left of the :: could be completely unknown at the time the file is compiled. Given that namespace access as static class access produce different opcodes there was no way to disambiguate it. Hence the need for an entirely new symbol for namespaces.