I’m using a foreach loop to iterate over an array. I’ve been using $array.indexof($element) to get the index of the current item being processed to use in inspecting a parallel array. I’ve seen mention of a $foreach variable or object that might be more effective and simpler than IndexOf but I can’t find any documentation on it. Unfortunately Google and Bing search don’t see a difference between “$foreach” and “foreach” so that isn’t helping.
So I found some docs on $foreach but they state that it is an enumerator and “you can use all the properties and methods of enumerators”. Started looking for docs on the properties and methods of enumerators and no luck there either.