Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56490 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76825 invoked from network); 23 Nov 2011 09:31:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Nov 2011 09:31:54 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.49 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.49 mail-qw0-f49.google.com Received: from [209.85.216.49] ([209.85.216.49:44717] helo=mail-qw0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/05-45113-88DBCCE4 for ; Wed, 23 Nov 2011 04:31:53 -0500 Received: by qadc16 with SMTP id c16so1228333qad.8 for ; Wed, 23 Nov 2011 01:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MZDxWMezWjy0b+B78NkKQPku8rJNn23MMXwS1Zc+N6E=; b=PxMU+T6sdy3atlgccEaVfloxELs+pUP/DyKwtjt51jPSJ3o298a8Ebf1FlZ15HeWhn n/47HELC2+zzY5vbboYKobwMgfK8vUntTC9ESbKMXJ8ZZc8W5m32Qk6eUYblO/a6S581 VQ/XEn4PhbS0s1aOH/ZNjiOsiLscpa95ca/PU= MIME-Version: 1.0 Received: by 10.224.72.210 with SMTP id n18mr10316405qaj.35.1322040708771; Wed, 23 Nov 2011 01:31:48 -0800 (PST) Received: by 10.229.38.134 with HTTP; Wed, 23 Nov 2011 01:31:48 -0800 (PST) In-Reply-To: <4ECCBC37.9060106@sugarcrm.com> References: <4ECC9ABE.1010709@sugarcrm.com> <4ECCBC37.9060106@sugarcrm.com> Date: Wed, 23 Nov 2011 10:31:48 +0100 Message-ID: To: Stas Malyshev Cc: Gustavo Lopes , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=20cf306f72fcd32e0004b26396ca Subject: Re: [PHP-DEV] intl IDNA patch From: tyra3l@gmail.com (Ferenc Kovacs) --20cf306f72fcd32e0004b26396ca Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Nov 23, 2011 at 10:26 AM, Stas Malyshev wro= te: > Hi! > > Technically, yes, it is possible. But is it desirable? It would require >> breaking the abstraction and looking at the actual values of the flags, >> choosing one of the unused bits (possibly a high one) and hope it'll nev= er >> be used in future. Plus, in the current patch, the value of the variant >> completely changes the return value (from string to array) so if it's mo= re >> appropriate to single it out. >> > > I think yes, it's better to have one options set than "options" and > "another options which aren't first options but different options". I don= 't > think there's breaking of abstraction if we use more options that ICU has= , > and probability of ICU using all 32 bits seems quite low for me now. > Yeah, albeit low, there is still a chance that in the future we got some clashing between their options and ours, so I think it would be better to separate those. > > I don't think we should return array there - it makes using the function > much more awkward since you need to check options before you know what it > returns. I think it's better to have normal return always a string, > abnormal can be handled by a special value if the user cares. > > I don't really care or way or the other about pass-by-ref vs mixed retur= n, >> but I don't think your position on that issue is clear here, as you only >> affirm that trying to force generic intl error reporting is not an optio= n >> (which I've also argued). If there are no objections, I'll advance with >> mixed return, as Pierre has announced. >> > > Actually, that's what I was objecting to. I think mixed return (i.e. > function returning array or string depending on option) is not the best > option. I think for most use cases people would just use the string and i= f > the return is false they can either say "bad domain name" and be done wit= h > it, or parse the error codes and create special handling for each of them > if they like. But I don't think there's a need to add so much complicatio= n > by making the same function return two types. I thought that we already agreed using an output argument for getting the specific error instead of returning either a string or an array. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --20cf306f72fcd32e0004b26396ca--