RE: [PHP] Reasoning behind using quotes for associative array element access?
| From: | Richard Heyes | Date: | Fri, 11 Aug 2000 22:29:40 +0000 |
| Subject: | RE: [PHP] Reasoning behind using quotes for associative array element access? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11426@lists.php.net to get a copy of this message | ||
> If you look at it from PHP's perspective and plain text is a CONSTANT.
> So if you don't put quotes around the "element" it should
> assume it's been
> defined().
> Of course php is smart enough to know if it's plain text and
> not defined()
> assume 'text'.
> You are just putting the PHP through more steps if you don't
> quote the array
> elements.
Not to mention it's really irratating to find code you've just
downloaded throw up a trillion and a quarter warnings because things
like this are prolific throughout it.
IMO (of course...) developing with error_reporting() at 15 or equiv.
produces 'better' and 'cleaner' code. Not to mention it's a great help
to debugging.
--
Richard Heyes
http://www.heyes-computing.net/scripts/
Plain text email only please!