[Q] Parser behavior in a string
| From: | Yasuo Ohgaki | Date: | Tue, 20 Mar 2001 05:16:23 +0000 |
| Subject: | [Q] Parser behavior in a string | ||
| Groups: | php.lang | ||
| Request: | Send a blank email to php-lang+get-127@lists.php.net to get a copy of this message | ||
I noticed that PHP4 accept and does not raise error (notice messages) for
following line.
$arr = array('first' => 'one');
$str = "This is first element of array: $arr[first]";
//Following line cause parse error
//$str = "This is first element of array: $arr['first']";
Question: Is this expected behavior that PHP parse w/o errors?
If this is not a expected behavior and subject to change, I'm not going to use
array w/o ' or " for assoc arrays. Because I'm going to log all error messages
for production system including notice messages.
Thank you.
--
Yasuo Ohgaki