php make a arraylist cast to class code example Example: object to array php $array = (array) $yourObject;