public static function decode($json, $assoc = false, $maxDepth = 512)
	{
		$result = @json_decode($json, $assoc, $maxDepth);
		
		if($result === NULL)
		{
			switch($error = json_last_error())
			{
				case JSON_ERROR_NONE:
					return NULL;
				case JSON_ERROR_CTRL_CHAR:
					throw new JsonUnserializationException('An invalid control character was found in JSON-encoded data', $error);
				case JSON_ERROR_DEPTH:
					throw new JsonUnserializationException(sprintf('Maximum nesting depth of %u exceeded in JSON-encoded data', $maxDepth), $error);
				case JSON_ERROR_SYNTAX:
					throw new JsonUnserializationException('A syntax error has been detected in JSON-encoded data', $error);
				default:
					throw new JsonUnserializationException('An unknown error occured while unserializing JSON-encoded data', $error);
			}
		}
		
		return $result;
	}
public static function decode($json, $assoc = false, $maxDepth = 512)
	{
		$result = @json_decode($json, $assoc, $maxDepth);
		
		if($result === NULL)
		{
			switch($error = json_last_error())
			{
				case JSON_ERROR_NONE:
					return NULL;
				case JSON_ERROR_CTRL_CHAR:
					throw new JsonUnserializationException('An invalid control character was found in JSON-encoded data', $error);
				case JSON_ERROR_DEPTH:
					throw new JsonUnserializationException(sprintf('Maximum nesting depth of %u exceeded in JSON-encoded data', $maxDepth), $error);
				case JSON_ERROR_SYNTAX:
					throw new JsonUnserializationException('A syntax error has been detected in JSON-encoded data', $error);
				default:
					throw new JsonUnserializationException('An unknown error occured while unserializing JSON-encoded data', $error);
			}
		}
		
		return $result;
	}
public static function decode ( $ json , $ assoc = false , $ maxDepth = 512 ) { $ result = @ json_decode ( $ json , $ assoc , $ maxDepth ) ; if ( $ result === NULL ) { switch ( $ error = json_last_error ( ) ) { case JSON_ERROR_NONE : return NULL ; case JSON_ERROR_CTRL_CHAR : throw new JsonUnserializationException ( 'An invalid control character was found in JSON-encoded data' , $ error ) ; case JSON_ERROR_DEPTH : throw new JsonUnserializationException ( sprintf ( 'Maximum nesting depth of %u exceeded in JSON-encoded data' , $ maxDepth ) , $ error ) ; case JSON_ERROR_SYNTAX : throw new JsonUnserializationException ( 'A syntax error has been detected in JSON-encoded data' , $ error ) ; default : throw new JsonUnserializationException ( 'An unknown error occured while unserializing JSON-encoded data' , $ error ) ; } } return $ result ; }
Decode the given JSON string into a PHP data structure.

@param string $json The JSON-encoded input data.
@param boolean $assoc Serialize JSON objects into PHP arrays?
@param integer $maxDepth Maximum nesting depth of JSON input.
@return mixed

@throws JsonUnserializationException When any error occurs during unserialization. The exceptions
code is set to the error code returned by json_last_error().
Decode the given JSON string into a PHP data structure .