Re: ZendCodeAnalyzer oddity

From: Date: Wed, 31 Oct 2012 23:34:34 +0000
Subject: Re: ZendCodeAnalyzer oddity
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-319648@lists.php.net to get a copy of this message
On Wed, Oct 31, 2012 at 3:42 PM, Christoph Boget <christoph.boget@gmail.com> wrote: > Consider the following code: > > <?php > class bob > { > static function factory() > { > echo 'In factory!<br>'; > } > } > > bob::factory(); > $var = 'bob'; > $var::factory(); > ?> > > When I run this, "In Factory!" is displayed twice, as I would expect. So by > all accounts, there's nothing wrong with the code. However, when I run that > file through ZendCodeAnalyzer, I get the following error: > > (line 11): Zend Engine message: parse error > [Zend Code Analyzer] Aborted. > > Line 11 is this: > > $var::factory(); > > So why is ZendCodeAnalyzer reporting that as a parse error? Shouldn't it > behave as PHP does and play nice with it? > > I'm running PHP 5.3.15, Zend Code Analyzer 1.2.2 > > thnx, > Christoph I'm not sure why ZendCodeAnalyzer would think that's an error. Maybe try: ${var}::factory(); and see if it still dislikes it.

« previous php.general (#319648) next »