ID:               16147
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: win 2000
 PHP Version:      4.1.2
 New Comment:

Just a fyi, with:

print $array[foo];

PHP looks for a constant named foo first, if it does not exist then
it'll shout an error of level E_NOTICE and then look for the key foo
(which is what you wanted) ...

error_reporting can be set about anywhere, including php.ini, .htaccess
and the error_reporting() function.  And some code:

define('a', 'b'); 
$arr = array('a' => 'apple', 'b' => 'banana');
print $arr[a];   // banana
print $arr['a']; // apple

Moral of the story is you should always surround your array keys with
quotes! ;)


Previous Comments:
------------------------------------------------------------------------

[2002-03-18 11:41:48] [EMAIL PROTECTED]

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".


------------------------------------------------------------------------

[2002-03-18 11:39:17] [EMAIL PROTECTED]

Hello!
I have just installed php4 on my server, I'm running IIS on windows
2000.
When I run some scripts that I know work on other servers I get the
error:

"Warning: Use of undefined constant" and then the constant name etc.

Best Regards/
Leo Sten


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=16147&edit=1

Reply via email to