Bug #18465 Updated: strange warning
| From: | sniper@php.net | Date: | Tue, 23 Jul 2002 01:38:31 +0000 |
| Subject: | Bug #18465 Updated: strange warning | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14839@lists.php.net to get a copy of this message | ||
ID: 18465
Updated by: sniper@php.net
Reported By: horny@mail.az
-Status: Open
+Status: Bogus
-Bug Type: Compile Warning
+Bug Type: *General Issues
Operating System: Windows XP
PHP Version: 4.2.1
New Comment:
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
Hint: Try defining the constant before you use the function where it's
used..
Previous Comments:
------------------------------------------------------------------------
[2002-07-22 02:50:23] horny@mail.az
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 this bug report at http://bugs.php.net/?id=18465&edit=1