I have the ultimate goal of such a reduction - recursive function build a hierarchy of database via PHP. In the case of the find () passing an array stops on the last item in the first nesting level and are not passed on the levels below . Something I have done wrong in the case of an object , but an array of all turned out perfectly .
Show us any sample of your code. Im guessing that you are iterating same object in array ? Then in nested loops you will change a pointer of resultset, that's why you have problem. You would need to work on plain array toArray method. Or clone resultset for each new loop.