public function serialize()
	{
		$it = new SerializedTokenIterator([]);

		$this->preSerialize($it);

		foreach($this->tokens as $token)
		{
			$token->serialize($it);
		}

		$this->postSerialize($it);
		
 		return json_encode($it->getArrayCopy());
	}
public function serialize()
	{
		$it = new SerializedTokenIterator([]);

		$this->preSerialize($it);

		foreach($this->tokens as $token)
		{
			$token->serialize($it);
		}

		$this->postSerialize($it);
		
 		return json_encode($it->getArrayCopy());
	}
public function serialize ( ) { $ it = new SerializedTokenIterator ( [ ] ) ; $ this -> preSerialize ( $ it ) ; foreach ( $ this -> tokens as $ token ) { $ token -> serialize ( $ it ) ; } $ this -> postSerialize ( $ it ) ; return json_encode ( $ it -> getArrayCopy ( ) ) ; }
Serializes a token container into an encoded string that consumes a
minimal amount of storage memory.

@return string
Serializes a token container into an encoded string that consumes a minimal amount of storage memory .