Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70838 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53869 invoked from network); 22 Dec 2013 22:35:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2013 22:35:24 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.240 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.240 imap2-1.ox.registrar-servers.com Received: from [198.187.29.240] ([198.187.29.240:45393] helo=imap2-1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/8A-04050-A2967B25 for ; Sun, 22 Dec 2013 17:35:23 -0500 Received: from [192.168.0.13] (unknown [94.13.99.191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 5D3595A0051; Sun, 22 Dec 2013 17:35:18 -0500 (EST) Message-ID: <52B76924.4060908@ajf.me> Date: Sun, 22 Dec 2013 22:35:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Stas Malyshev , Sara Golemon , PHP internals References: <52B76720.4030403@sugarcrm.com> In-Reply-To: <52B76720.4030403@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Base Conversion Clowniness From: ajf@ajf.me (Andrea Faulds) On 22/12/13 22:26, Stas Malyshev wrote: > Hi! > >> https://wiki.php.net/rfc/base-convert > > Just a little note - I don't think any option that adds warnings where > there were not warnings is acceptable in this case for any stable > version. There are dozens of ways extra warning could break an existing > app. > > Also, wouldn't simple regexp or filter or is_numeric check solve this > issue while allowing much more flexible reaction to wrong data? I'm not > sure that more warnings is better than more data checking. > I think it depends which release. If next 5.x, then I think a warning might be acceptable. My personal preference would be to make it act largely like string to int conversion works at present, where it stops at incorrect chars. Though I think it's tolerant of leading whitespace, for some reason, which I don't like. Hence, for some sort of consistency, I like option C best. I don't think throwing a warning in the next 5.x.y is a good idea though, but I personally don't think it's a bad idea for 5.6. However, my preferred behaviour would break B/C, so I'm not sure. -- Andrea Faulds http://ajf.me/