PHP doesn't have a native implementation of __toArray() like they do with __toString().
If you check out the PHP docs for converting to string, you'll see that the __toString() magic method is explicitly mentioned as a way to override the default implementation.
However, the documentation regarding type casting for arrays clearly states what happens when an object is converted to an array without mentioning any magic methods (emphasis mine)
Converting to array
For any of the types integer, float, string, boolean and resource, converting a value to an array results in an array with a single element with index zero and the value of the scalar which was converted. In other words, (array)$scalarValue is exactly the same as array($scalarValue).
If an object is converted to an array, the result is an array whose elements are the object's properties.....
....
Solution
The simple solution is to implement a ->toArray() method in your class - something many popular collection implementations do (including Laravel's Collection)
Another solution that may work is to have your class extend the ArrayObject class which allows objects to work as arrays.