Re: __call and recursion
| From: | Richard Quadling | Date: | Wed, 12 May 2010 10:28:05 +0000 |
| Subject: | Re: __call and recursion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305117@lists.php.net to get a copy of this message | ||
On 9 May 2010 22:21, Daniel Kolbo <kolb0057@umn.edu> wrote:
> Hello,
>
> I've defined a __call() method inside a class. Within the __call()
> method (after testing that the method exists and is callable I am using:
>
> call_user_func_array(array($this,$method), $args);
>
> However, this seems to be an infinite loop (and is crashing my test
> apache server). How, could I still use the __call() method and avoid an
> infinite loop of calling?
>
> Thanks,
> dK
__call() is receiving $method.
Do you alter $method in any way?
If not, calling call_user_func(array($this, $method), $args) will
simply call the non-existent function.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling