He was unpleasantly surprised by such unfortunate fact that these constructions work in a very peculiar and unpredictable way.
There is an array starting not with 0, but for example 2:
2 => object ;
3 => string;
4 => object;
So brute force with the help of
for each and
for in constructions of such an array will begin, correctly with 4 :). Rather, it’s not a fact that next time with 4 it can of course start with 3 (although there is a vague suspicion that there is a pattern!). In general, as he wants.
')
As knowledgeable people explained, it all depends on the sequence of filling the array. Although my array was filled very consistently.
As a result, he returned to the good old
forOsadochek remained however.
ZY in the regexp construction
/ \ b, the cyrillic \ b / will not work. With the Latin alphabet, \ b works.
ZYY if you take an array with the initial key 0, then the search is always ordered.
UPD
Dear
pixelcube user explained in the comments what the trick is.