You are here: Re: making a class object global « PHP Programming Language « IT news, forums, messages
Re: making a class object global

Posted by Jerry Stuckle on 11/17/06 12:32

Peter Fox wrote:
> Following on from Jerry Stuckle's message. . .
>
>> windandwaves wrote:
>>
>>> Hi gurus
>>>
>>> I have a class from which I create an object. I want this object to be
>>> available in all my functions for my application. Basically, I want to
>>> make the object global. What is the best way to do this?
>>>
>>> Thank you
>>>
>>> Nicolaas
>>>
>>
>> Like any other variable. Pass it as a parameter to the functions
>> (highly recommended) or make it global (not recommended).
>>
>
> Or stick it in $_SESSION. If you do that then make sure you understand
> the PHP version of variable/pointers/references and the use of &.
>
>
>
>

How is that going to help? It's a complete misuse of the $_SESSION
variable - which was never meant to replace the other superglobals such
as $_GLOBAL.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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