PHP parser behavior.

From: Date: Wed, 21 Mar 2001 03:17:21 +0000
Subject: PHP parser behavior.
Groups: php.dev 
Request: Send a blank email to php-dev+get-49584@lists.php.net to get a copy of this message
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

« previous php.dev (#49584) next »