cast arrays to objects instead of the other way around

the advantage is that objects that have magic methods don't need special
handling