|
Posted by Henk Verhoeven on 02/20/07 22:15
Hi Daniel,
given the note of Wolverine on
http://nl2.php.net/manual/en/language.oop.php
it seems like assinging $this will cause the assigned value to be
returned. When you replace
$this = func_get_arg(0);
return;
by
return func_get_arg(0);
you shoud get the same results in php4 and it should work in php5 too.
greetings,
Henk Verhoeven,
www.pphPeanuts.org.
Daniel Loose wrote:
> dear folks,
>
> I'm one more guy having the cannot re-assign $this problem.
>
> someone left a php4 file here containing the lines
>
> | function linkbar()
> | {
> | if(func_num_args() == 1)
> | {
>
> | $this = func_get_arg(0);
> | return;
> }
> ...
> | }
>
> inside a php4 class definition. func_get_arg(0) in this case delivers
> an object - working fine in php4. I struggled a bit with the &
> referencing (while not really understanding it and the problem) but
> gave up. how must I modify the code to get it to work in php5?
>
> thank you very much!!
>
> daniel
>
>
>
Navigation:
[Reply to this message]
|