Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86174 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48881 invoked from network); 12 May 2015 18:49:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2015 18:49:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:57586] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/61-41925-14B42555 for ; Tue, 12 May 2015 14:49:38 -0400 Received: from [192.168.0.101] ([88.134.68.210]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MJBn4-1Ytsry25Kk-002sTW; Tue, 12 May 2015 20:49:28 +0200 Message-ID: <55524B3A.1090302@gmx.de> Date: Tue, 12 May 2015 20:49:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: bishop@php.net, PHP internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:XChBxqD3vOxO0rS2FFuZPVg8xZSYgBm0qkb0bAQ6P1o/xTJ1XHd +QipfXIQ0/ZflSVMV0e7zLlUiqok76UEs60wCFMUFpAK4UqwzVOI/jeDHordcMdl0tqqNiA qRuDcu3A7WSPp2GXrvr+avFM7Z2rYWeuQteCQBxob6vxlNB8l0UP/d8gyoF1yy/hVOYBuTm YkczTsWUTlRvLlBL/pRNw== X-UI-Out-Filterresults: notjunk:1; Subject: Re: Static method call with single colon results in fatal error, not aparse error? From: cmbecker69@gmx.de (Christoph Becker) Bishop Bettini wrote: > class Foo { > public static function bar() { echo 'bar'; } > } > Foo:bar(); > > > Note the single colon. According to 3v4l ... > > 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. 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. -- Christoph M. Becker