Re: static vs global variable [message #172695 is a reply to message #172694] |
Sat, 26 February 2011 02:14 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 2/25/2011 7:40 PM, tobycraftse(at)yahoo(dot)com wrote:
>
> if I have a couple of variable want to included by many php file
>
> should i use global or static class variable?
>
> global is kinda trouble as i need to delcare global every php file i
> want to use it.
>
> static variable do not need to declare up front
If it's something you're using in functions, you should pass the values
as parameters to the functions. Otherwise your function code is
needlessly dependent on external values.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|