Re: Any difference between these 2 forms of syntax?
| From: | Austin Marshall | Date: | Sat, 11 May 2002 01:45:27 +0000 |
| Subject: | Re: Any difference between these 2 forms of syntax? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97057@lists.php.net to get a copy of this message | ||
Richard Davey wrote:
"Austin Marshall" <amars@pdq.net> wrote in message news:3CDC6E17.8020801@pdq.net...that's a possibility, but i'd suspect the overhead comes from when variables are actually inserted/replaced and/or characters escaped. I doubt there would be much of a difference between "status" and 'status' Nor would there be much of a diffrence between 'status '.$foo.' blah'; and "status $foo blah"; I'd be interested to see if there were much a difference performance-wise though.It all depends on what you use as a key... you just follow the normal string standards. If you want a variable evaluated within the key, then you must use "s if you purely use text then you just need 's. For example $x=$foo["status $y"]; vs. $x=$foo['status'];No variables included in the keys, so it looks like it's ' all the way - excellent, thank you. I wonder if it matters from an overhead point of view, is PHP doing more work than it ought to using " instead of ' because it's expecting variables? Cheers, Rich -- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995