Support overriding toArray
If an object does not support the Export interface, a child class may want to convert it before these base classes toArray is called. This also adds support for classes implementing the JsonSerializable interface.
If an object does not support the Export interface, a child class may want to convert it before these base classes toArray is called. This also adds support for classes implementing the JsonSerializable interface.