AW: [PHP-DEV] disallow non-static method calls with self/static in PHP 7
| From: | Robert Stoll | Date: | Sun, 12 Oct 2014 09:22:21 +0000 |
| Subject: | AW: [PHP-DEV] disallow non-static method calls with self/static in PHP 7 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77898@lists.php.net to get a copy of this message | ||
> In your given example, $this is defined when A::bar() is called; interestingly, when this class
> is extended it will
still only call
> A::bar() as opposed to calling $this->bar(). Whether this is useful behaviour is irrelevant
> :)
>
Right, I completely forgot that. So calling it with self instead of $this actually could make sense.
Cheers :)