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