php typecast as both array or object code example Example: php convert array to object $object = (object) $array;