They won't be the same (which you could check by running it with sample arrays). Take another look at the foreach block ... there's a logical AND in there, meaning the second operation will only be performed if the first was true -- and the first is true only when a previously seen key waltzes through the loop. Thus %union will contain every element in both arrays, but %isect will only contain elements common to both arrays (the arrays are assumed to be unique).
In reply to Re: mistake in style guide?
by danger
in thread mistake in style guide?
by thpfft
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |