Re: AW: [PEAR-DEV] solution for BC breakage
| From: | Greg Beaver | Date: | Tue, 16 Sep 2003 22:58:20 +0000 |
| Subject: | Re: AW: [PEAR-DEV] solution for BC breakage | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-21596@lists.php.net to get a copy of this message | ||
Stephan Schmidt wrote:
2. If you are defining any global variables in your files, you have to use $GLOBALS["myVar"] instead of $myVar. Otherwise the are not defined in theThis is highly recommended anyways - otherwise users can't load packages on demand in a function. I always use $GLOBALS["_PACKAGE_MYVAR"] in my PEAR packages for this reason. Inside functions and methods, you can always use the global keyword, but the extra characters of $GLOBALS in top-level code translate into a heap of benefits. Regards, Greg