Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

How do you access to a variable in a class from another class?

$
0
0

Hi,

I need to hold a value globally which could be user ID or DB object and so on.

 

The value must be accessible from any classes or files. In this case which design pattern would you use?

 

Superglobals? Constants? Singleton? Static?

 

Thanks in advance

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles