Re: lost return value during a static call
| From: | Richard Quadling | Date: | Thu, 15 Sep 2011 14:10:46 +0000 |
| Subject: | Re: lost return value during a static call | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314873@lists.php.net to get a copy of this message | ||
On 15 September 2011 14:01, chamila gayan <cgchamila@gmail.com> wrote:
> hi All,
>
> I'm seeing a weired behavior in following code
> http://pastebin.com/B5q8i1RY
>
> when it goes through 2 static methods, at some point it stops returning
> value to the calling method. (please see comments in-line).
>
> may be I'm doing this in a wrong way so your suggestions are welcome. And I
> really appreciate if someone can explain how 'return' behaves with static
> methods specially when they are called recursively. thanks a bunch
>
> chamila
>
New pastie http://pastebin.com/AnZ1r7yR
Output is ...
Z:\ppp.php 108parentclass::getChild 29parentclass::getChild
40parentclass::getArray 22parentclass::getChild
29parentclass::getChild 32parentclass::childload
6parentclass::childload 9childA::__construct 54childA::setA
67childA::setA 69childA::__construct 56parentclass::getChild 34childA
Object( [a:childA:private] => 1)parentclass::getArray
24parentclass::getChild 42parentclass::getChild 44Z:\ppp.php
110Z:\ppp.php 112
Using PHP 5.3.9-dev on Win32.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea