Re: Static method call with single colon results in fatal error, not aparse error?
| From: | Bishop Bettini | Date: | Tue, 12 May 2015 19:05:14 +0000 |
| Subject: | Re: Static method call with single colon results in fatal error, not aparse error? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86176@lists.php.net to get a copy of this message | ||
On Tue, May 12, 2015 at 2:49 PM, Christoph Becker <cmbecker69@gmx.de> wrote:
> Bishop Bettini wrote:
>
> > class Foo {
> > public static function bar() { echo 'bar'; }
> > }
> > Foo:bar();
> >
> >
> > Note the single colon. According to 3v4l <XLRß—ŠÿØ
> > 4üø6Nhttp://3v4l.org/Ot3Fk>...
>
> Foo:bar();
>
> is the same as
>
> Foo:
> bar();
>
> so it is parsed as labelled statement, and as such is syntactically
> valid since PHP 5.3.
>
Ah, labels, right. Thanks!
I will now go off and grumble that labels should mandate, rather than just
accept, block scope since it's easy to forget one half of Paamayim
Nekudotayim....