Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70840 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64690 invoked from network); 22 Dec 2013 23:10:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2013 23:10:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.160.43 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.160.43 mail-pb0-f43.google.com Received: from [209.85.160.43] ([209.85.160.43:65103] helo=mail-pb0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/EC-04050-35177B25 for ; Sun, 22 Dec 2013 18:10:11 -0500 Received: by mail-pb0-f43.google.com with SMTP id rq2so4639955pbb.30 for ; Sun, 22 Dec 2013 15:10:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=ZDPEX+YBC1dTVuyp+RkjWlmET0A67bpwhz+hQcjbP5k=; b=UG83ZhTrEewcqFqjHdkNMEh/Md/atnxsN+ChHwAHm1g9SuDW/ZJcQfzd8v7mnbTmU1 TlCzUkz3mYpsaC8auqto3n2/VVmiN7rKvSIdEPSTdD1jd3lq6C7XQtkFzanfyZ1uW6At nzt5Q6FrQoo1FlNmtMHCyDgLWAMrLHpgYS601kU1uMJ1rLiCNxNvw6vGGTbgfLdXdCTs /1kr2qkO+NsZ3Ec/gROIBrRnZdKG2gbJaw1o2DUY/drAEdnpVTe6IPKWyO+boNvTevYz K6TGX62ZHpIxugpU+u6GpaUUi+KaAGBaYpse8d1d87BhKVJAe/ZGzB6coZD35E5XG068 coyg== X-Gm-Message-State: ALoCoQmGVjqnz/mBhRJok0MfNjXUD2aq1r1mjKDPUHrnPLAgqt72I/pZhIXb40QG9+AmT73dNHyh MIME-Version: 1.0 X-Received: by 10.68.191.106 with SMTP id gx10mr22661270pbc.47.1387753808603; Sun, 22 Dec 2013 15:10:08 -0800 (PST) Sender: php@golemon.com Received: by 10.70.77.164 with HTTP; Sun, 22 Dec 2013 15:10:08 -0800 (PST) X-Originating-IP: [24.130.180.66] In-Reply-To: <52B76720.4030403@sugarcrm.com> References: <52B76720.4030403@sugarcrm.com> Date: Sun, 22 Dec 2013 15:10:08 -0800 X-Google-Sender-Auth: WkPJj6shryamLAlj211fMXvEJk8 Message-ID: To: Stas Malyshev Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Base Conversion Clowniness From: pollita@php.net (Sara Golemon) > 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. > I can see the argument for that, though anything depending on buggy conversion is probably broken. > 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. > Sure, one could validate before conversion with something like: if (strcmp($val, base_convert($val, $base, $base))) { /* $val isn't purely in base $base */ } else { $newval = base_convert($val, $base, $newbase); } And a proper app *should* have logic like that regardless. However I do think that when apps don't apply such forward-thinking logic, we should be prepared to be noisy about it (as we do with an fopen() call which wasn't preceeded by an is_readable()/is_writable() check) -Sara