ID: 46668 Updated by: [EMAIL PROTECTED] Reported By: nightstorm at tlen dot pl -Status: Open +Status: Bogus Bug Type: Feature/Change Request PHP Version: 6CVS-2008-11-25 (CVS) New Comment:
You'd break all previously written PHP code if :: suddenly became a namespace separator. Previous Comments: ------------------------------------------------------------------------ [2008-11-25 17:09:13] nightstorm at tlen dot pl Description: ------------ Hi everyone, I've recently read about some controversies concerning the new namespace operator and I noticed a possible solution which I want to share with you. Unfortunately, it breaks the backward compatibility. The idea is to use "->" both for normal object and static class element access, as id does not introduce any ambiguity and can be resolved directly by the lexical parser: $variable->field - object call $variable->method() - object call ClassName->field - static call ClassName->method() - static call ClassName->method()->method2()->field - first one is static, the rest are object calls. Now "::" can be used as the namespace access operator. I use the same rules in my template engine to convert the object calls to the PHP syntax and I'm pretty sure they are correct. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46668&edit=1