As to A, the most complete short answer I can give you is "Yes". The performance is definatly different between them. Which one has the best performance depends on what you're doing with them. As far as B, there is no difference. "for" and "foreach" are exactly the same, except one will get you a four-stroke penalty in golf.
In reply to Re: grep, map vs. foreach performance
by theorbtwo
in thread grep, map vs. foreach performance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |