turning a stdclass object into an array

Solutions on MaxInterview for turning a stdclass object into an array by the best coders in the world