This may or may not be considered a bug. But it seems weird to me though, so figured I would bring it to light to see what others think.

It appears that IIF() evaluates data in all blocks, instead of just the block that should be returned.

Example...
 Code:
$array = '1','2','3'
$test = IIf(1, $array[0], $array[3])
This fails because array[3] is out of bounds, even though in my opinion it should only evaluate the code that says array[0] and ignore the other block.

I ran across this issue, trying to golf down some code, so it probably wouldn't be an issue for most uses. But what do you guys think?