in reply to list returned from function

As some of the examples above illustrate, always remember that an array index starts at zero. When you asked for the "5 element" do you mean the "5th element"?
$elem = (myFunc())[4]; #fifth element $elem = (myFunc())[5]; #sixth element
It may have just been a typo, but I thought I'd point it out