Are there any differences between get_object_vars($obj) and (array) $obj ?
get_object_vars($obj)
(array) $obj
Both seem to return the public properties of the object.
Better is what is what you actually need. get_object_vars() doesn’t show private and protected members. See this comment in the manual for an example.