Using Global Variables

December 12th, 2008 | by Kennith |

global $g_evil_variable;

I used to confused with the use of global variables.

I thought global variables were evil because I used to find it hard to read the program. I tried to avoid it as much as I can.

Now I found I encounter a lot of source code use global variable and the programmer use it in a smart way. It started to change my view of using the global variable.

It is not that evil after all, if you know how to use it.

Post a Comment