Reputation: 89
Is it possible to iterate over an associative array with wildcard "*" using foreach loop?
Upvotes: 0
Views: 2229
Reputation: 13967
No. IEEE 1800-2012 § 7.8.1 Wildcard index type states:
Associative arrays that specify a wildcard index type shall not be used in a foreach loop (see 12.7.3) or with an array manipulation method (see 7.12) that returns an index value or array of values.
Upvotes: 3