Bug #2653: Constants defined but not viewable
| From: | leon at clearink dot com | Date: | Wed, 03 Nov 1999 00:36:16 +0000 |
| Subject: | Bug #2653: Constants defined but not viewable | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12086@lists.php.net to get a copy of this message | ||
From: leon@clearink.com
Operating system: Solaris
PHP version: 3.0.12
PHP Bug Type: Parser error
Bug description: Constants defined but not viewable
<?
function test()
{
if(defined("SOME_CONSTANT")) print("YES: ");
print(SOME_CONSTANT);
}
define("SOME_CONSTANT", "the value of the constant");
test();
?>
This produces "YES: SOME_CONSTANT". I know I may be using constants in an unintended way,
but I'd like to set a constant value sometime after I've defined a function that uses it.
If this use is disallowed, I'm cool with that decision, but in that case, I'd like to see
a parse error about an unrecognized token.