Re: ZendCodeAnalyzer oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 31, 2012 at 3:42 PM, Christoph Boget
<christoph.boget@xxxxxxxxx> 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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux