Bug #18465: strange warning

From: Date: Mon, 22 Jul 2002 06:50:24 +0000
Subject: Bug #18465: strange warning
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14765@lists.php.net to get a copy of this message
From: horny@mail.az Operating system: Windows XP PHP version: 4.2.1 PHP Bug Type: Compile Warning Bug description: strange warning Hi there, here's a compileable snippet that reproduces the problem: <?php ini_set('error_reporting', E_ALL); $AVAILABLE_LANGS = array('az' => _('az'), 'ru' => _('ru'), 'en' => _('en')); # as per RFC 1766 define('DEFAULT_LANG', 'ru'); # index into the above array $MSG = array( "ru" => array( "az" => "Azeri", "ru" => "Russian", "en" => "English", ), ); function _($str) { if (isset($GLOBALS["MSG"][DEFAULT_LANG][$str])) return $GLOBALS["MSG"][DEFAULT_LANG][$str]; return $str; } ?> D:\>c:\php\php-cli haha.php Notice: Use of undefined constant DEFAULT_LANG - assumed 'DEFAULT_LANG' in haha.php on line 16 Notice: Use of undefined constant DEFAULT_LANG - assumed 'DEFAULT_LANG' in haha.php on line 16 Notice: Use of undefined constant DEFAULT_LANG - assumed 'DEFAULT_LANG' in haha.php on line 16 If I don't call _() above, as in _('az'), it all goes well. -- Edit bug report at http://bugs.php.net/?id=18465&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18465&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18465&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18465&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18465&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18465&r=support Expected behavior: http://bugs.php.net/fix.php?id=18465&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18465&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18465&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18465&r=globals

« previous php.bugs (#14765) next »