public function serialize()
    {
        $array = $this->jsonSerialize();
        array_walk_recursive($array, function (&$item, $key) {
            if ($item instanceof SimpleXMLElement) {
                $item = json_decode(json_encode((array)$item), true);
            }
        });

        return serialize($array);
    }
public function serialize()
    {
        $array = $this->jsonSerialize();
        array_walk_recursive($array, function (&$item, $key) {
            if ($item instanceof SimpleXMLElement) {
                $item = json_decode(json_encode((array)$item), true);
            }
        });

        return serialize($array);
    }
public function serialize ( ) { $ array = $ this -> jsonSerialize ( ) ; array_walk_recursive ( $ array , function ( & $ item , $ key ) { if ( $ item instanceof SimpleXMLElement ) { $ item = json_decode ( json_encode ( ( array ) $ item ) , true ) ; } } ) ; return serialize ( $ array ) ; }
Serializes the Email object.

@return string
Serializes the Email object .