On 11/08/2004, at 12:16 AM, Jay Blanchard wrote:
They should be global already...
http://us3.php.net/manual/en/language.constants.php
"Like superglobals, the scope of a constant is global. You can access constants anywhere in your script without regard to scope. For more information on scope, read the manual section on variable scope."
Ok, just figured out the problem:
<? function test() { define('PET_NAME','Fluffy'); } define('PET_TYPE','Cat'); echo PET_NAME." is a ".PET_TYPE; // fails ?>
I didn't activate test() :)
<? function test() { define('PET_NAME','Fluffy'); } test(); define('PET_TYPE','Cat'); echo PET_NAME." is a ".PET_TYPE; // works ?>
--- Justin French http://indent.com.au
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php