public static function decode($string, $asArray = false)
    {
        $decoded = self::safeDecode($string, $asArray);
        if (is_null($decoded) == false) {
            return $decoded;
        }
        $code = self::lastError();
        if ($code === JSON_ERROR_NONE) {
            return $decoded;
        }
        throw new JsonDecodeException(self::lastErrorMessage(), $code);
    }
public static function decode($string, $asArray = false)
    {
        $decoded = self::safeDecode($string, $asArray);
        if (is_null($decoded) == false) {
            return $decoded;
        }
        $code = self::lastError();
        if ($code === JSON_ERROR_NONE) {
            return $decoded;
        }
        throw new JsonDecodeException(self::lastErrorMessage(), $code);
    }
public static function decode ( $ string , $ asArray = false ) { $ decoded = self :: safeDecode ( $ string , $ asArray ) ; if ( is_null ( $ decoded ) == false ) { return $ decoded ; } $ code = self :: lastError ( ) ; if ( $ code === JSON_ERROR_NONE ) { return $ decoded ; } throw new JsonDecodeException ( self :: lastErrorMessage ( ) , $ code ) ; }
Decodes a JSON string, or throws JsonDecodeException on failure

@param string $string
@param bool $asArray
@return mixed
@throws JsonDecodeException
Decodes a JSON string or throws JsonDecodeException on failure