You are here: Re: Class variable problem « PHP Programming Language « IT news, forums, messages
Re: Class variable problem

Posted by Colin Fine on 10/16/06 21:48

tatsudoshi wrote:
> Hello,
>
> I have this class http://pastebin.com/807571, where I set some variables on
> __construct. Originaly I set the $total_? variables when the function
> showLayout() was called. I know pastebin is having problems, so if you can't
> get the code, I will upload it in plain text on my own server.
> This function is called from a page object, which is called from a
> controller and so on.
> Doing it this way meant that all variables set during the showLayout()
> function, were set to null, next time I opened the object.
> Then I set it up like it is now, where I set all call variables doring
> __construct and this worked fine.
> But now the problem is, that the last values added to the class variables
> from the showLayout() function are not added.
>
> Is this a bug in PHP5 or am I doing something terribly wrong here?
>
> Best regards, tatsudoshi
>
>
You'll need to be more explicit about what you're expecting to see, and
what you are seeing.

I thought it might be a problem with references (in PHP5 Objects are
copied by references, but arrays are not) but I can't see a place where
you're assigning to a copied array, so it doesn't appear to be that.

Colin

 

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

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