register_global = on ? VamVan wrote: So guys, I found some thing strange that happened to me yesterday. Its small but kinda freaked me out.So I have a tokenmap.php that I include include in different configuration files. Some are classes and some are simple php files. So in my tokenmap.php I have declared an array as global. SO $GLOBAL['tokenmap'] = array() As a good programming practice what I did was: require_once('tokenmap.php'); $tokenmap = array(); $tokenmap = $GLOBAL['tokenmap']; print_r($tokenmap); The above displays empty array But when I do this , it works require_once('tokenmap.php'); $tokenmap = $GLOBAL['tokenmap']; print_r($tokenmap); Its kind of wierd for me. I am trying to understand. Can some one shed some light on it for me. Thanks --
惠 新宸 xinchen.hui | SYS | (+8610)82602112-7974 | :laruence |
Title: Laruence's Signature
- [PHP] Wierd Variable Initialization VamVan
- Re: [PHP] Wierd Variable Initialization 惠新宸
- Re: [PHP] Wierd Variable Initialization 惠新宸
- Re: [PHP] Wierd Variable Initialization Chris
- RE: [PHP] Wierd Variable Initialization Ford, Mike