Re: Static method call with single colon results in fatal error, not a parse error?
| From: | S.A.N | Date: | Tue, 12 May 2015 18:49:27 +0000 |
| Subject: | Re: Static method call with single colon results in fatal error, not a parse error? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86173@lists.php.net to get a copy of this message | ||
Foo::bar();
Output for 5.0.0 - 5.6.8, php7@20140507 - 20150501, hhvm-3.6.0 - 3.7.0bar
http://3v4l.org/F6tXZ
2015-05-12 21:44 GMT+03:00 Bishop Bettini <bishop@php.net>:
> class Foo {
> public static function bar() { echo 'bar'; }
> }
> Foo:bar();
>
>
> Note the single colon. According to 3v4l
> <http://3v4l.org/Ot3Fk>...
>
> 5.2.17 and earlier:
> Parse error: syntax error, unexpected ':'
>
> 5.3 and later, including 7 and HHVM:
> Fatal error: Call to undefined function bar()
>
>
> Is this really a run-time fatal error? Unless I missed a memo, surely this
> should be a compile time error.