Double-Colon Always Follows the 'parent' Keyword?

From: Date: Mon, 11 Mar 2013 11:19:48 +0000
Subject: Double-Colon Always Follows the 'parent' Keyword?
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hello everyone,

I have a question about the internals of PHP, but this is not about
advancing the development of the language, so I apologize if this is
on the wrong list.  I am choosing to post to this list because I
believe the people here are most qualified to answer my question.

This is what I want to know: Is there any valid situation in PHP where
the ‘parent’ keyword is not followed by the scope-resolution operator?
I am asking to help me decide on the best way to fix a bug for
php-mode[1] for GNU Emacs.  Consider these three lines:

    echo $parent;
    echo parent::$foo;
    echo $this->parent;
Emacs correctly highlights the first ‘parent’ as a variable name. It also highlights ‘parent’ in the second line as a keyword, as it should. But in the third line it treats ‘parent’ as a keyword instead of a variable and applies the wrong syntax formatting. My idea to fix this problem is to only treat ‘parent’ as a keyword if the scope-resolution operator immediately follows it. But before doing that I want to know whether or not that is true. So is there are valid situation where the keyword ‘parent’ does not have ‘::’ after it? Thank you in advanced for any advice and help. [1]: https://github.com/ejmr/php-mode -- ejmr 南無妙法蓮華經

Thread (5 messages)

« previous php.internals (#66581) next »