If you read my post you'll see I added the "no $" after the original post. Ignoring those cases the single quote wins. You can blame the extra character if you want but i beleive that is the whole point here. If you use double quotes then you have to escape characters and it makes a noticable difference in speed. You should also have noticed that I mentioned the speed gain is minimal at very best. There is no reason at all to use these speed tests in a design choice.
for the rest because processing a backslash in a double quoted string means checking more cases than in a single quoted string. Isn't that realy the point that I was showing. Double quotes ARE slower because of the restrictions they impose, but they are only slower if it actualy contains something that needs escaped. Is that speed difference important? I would say not in normal use, but maybe for some special case.
In reply to Re^5: To Single Quote or to Double Quote: a benchmark
by eric256
in thread To Single Quote or to Double Quote
by NateTut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |