You are here: Re: cannot re-assign $this ... « PHP Programming Language « IT news, forums, messages
Re: cannot re-assign $this ...

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация