Does Scope-Resolution Operator Always Follow 'parent'?

[email protected] (Eric James Michael Ritz)
Newsgroups php.general
Message-ID <[email protected]>
Hello everyone,

I have a question about the `parent` keyword: is there any valid
situation where it can appear without the `::` operator following?

I am asking to fix a bug in php-mode[1] for GNU Emacs.  Consider the
following code:

     echo $parent;
     echo parent::$foo;
     echo $this->parent;

The mode incorrectly highlights `parent` in the final line as if it
were the keyword, but PHP itself treats it as a member of an object.
My idea for fixing this incorrect syntax highlighting is to only treat
`parent` as a keyword if the `::` operator follows it.  But I want to
make sure that this assumption is correct.

Thanks in advanced for any help!


[1]: https://github.com/ejmr/php-mode

--
ejmr
南無妙法蓮華經
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.