note 30623 deleted from function.array by didou
| From: | didou@php.net | Date: | Thu, 17 Jun 2004 20:07:42 +0000 |
| Subject: | note 30623 deleted from function.array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71251@lists.php.net to get a copy of this message | ||
Note Submitter: wolke74@web.de
----
It is not wrong to write in a file named foobar.php.
<?php
$foo = array(foo => "foo", bar =>"bar");
echo $foo[foo]."<br>\n";
?>
If you start that program in PHP 4.2., you get the warnings.
Notice: Use of undefined constant foo, assumed 'foo' in
foobar.php at line 2
Notice: Use of undefined constant bar, assumed 'bar' in
foobar.php at line 2
Notice: Use of undefined constant foo, assumed 'foo' in
foobar.php at line 3
foo
If the entries of an associative array are strings, then you SHOULD quote them.
Greetings,
Wolke