Yep Olaf is right here. I think I understand your confusion though. You’re expecting the result to be 1 yes?
What’s happening is essentially nested objects. When you do the $array assignment, you’re creating two objects in the array, which each have ‘sub objects’, if you will. You then are setting $result equal to a filter, which actually happens to be only 1 object, which has 3-sub objects in it. Because of this, it’s returning that top level object which has 3 objects. If you want to ‘force’ it to a single object, you can try casting the variable to an array: