I didn't get responses for post in php-general, php-lang.....
I noticed that PHP4.0.4pl1 under Linux/Apache DSO and PHP4.0.5-RC1 under
W2K/IIS5 CGI accepts and does not raise error (notice messages) for following
code.
$arr = array('first' => 'one');
$str = "This is first element of array: $arr[first]"; // Without quotations
Question: Is this expected behavior that PHP parse w/o errors?
If this is NOT a expected behavior or subject to change.. I would like to know,
since I'll handle all error messages for production system including notice
messages.
Thank you.
PS:
$str = "This is first element of array: $arr['first']"; // I prefer this syntax,
but this line cause parse error.
Using {} may be the best way to work with assoc arrays in strings, but
$arr[first] is a bit easier to read than {$arr['first']}.
--
Yasuo Ohgaki
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
- RE: [PHP-DEV] PHP parser behavior. Yasuo Ohgaki
- RE: [PHP-DEV] PHP parser behavior. Chris Newbill