Hi Eric,

On Sun, Mar 10, 2013 at 8:21 PM, Eric James Michael Ritz <
lobbyjo...@gmail.com> wrote:

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

I wouldn't have thought it possible, but I just found one case with PHP 5.4
where it can appear as the keyword without a trailing "::". Apparently you
can use it to instantiate the parent class just as you can with "new self".

    class Foo { }
    class Bar extends Foo {
        public function foo() {
            return new parent;
        }
    }

I think you'll be safe if you can highlight it only when preceded by "new"
or followed by "::".

David

Reply via email to