|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-22 21:38 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 02:00:01 2026 UTC |
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.