Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40762 invoked from network); 22 Feb 2015 01:35:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2015 01:35:38 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:39228] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/AD-08895-66239E45 for ; Sat, 21 Feb 2015 20:35:36 -0500 Received: (qmail 29453 invoked by uid 89); 22 Feb 2015 01:35:32 -0000 Received: by simscan 1.3.1 ppid: 29445, pid: 29448, t: 0.1367s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.189.147.37) by mail4.serversure.net with ESMTPA; 22 Feb 2015 01:35:32 -0000 Message-ID: <54E93263.2030601@lsces.co.uk> Date: Sun, 22 Feb 2015 01:35:31 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: francois@php.net, internals@lists.php.net References: <7ef509ef10bb345c792f9d259c7a3fbb@mail.gmail.com> <54E91123.9010508@lsces.co.uk> <066d01d04e33$82dca020$8895e060$@php.net> In-Reply-To: <066d01d04e33$82dca020$8895e060$@php.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Coercive Scalar Type Hints RFC From: lester@lsces.co.uk (Lester Caine) On 22/02/15 00:07, François Laupretre wrote: >>> 3. "1E07" might be construed as overly generous assuming we are >>> > > excluding stringy integers like hex, oct and binary >> > Yet again ... If we have to add a lot of extra checks then why can't we >> > simply ask if the data is a usable integer. At the end of the day it >> > does depend on where the data was sourced? Binary data is only usable if >> > we know that it is binary, or we will be converting some other format >> > anyway? > I asked you for rules to recognize octal. I am all in favor of recognizing other numeric strings, hexa with leading 0x (detecting trailing h is more ambiguous and slower), for instance. It was removed some weeks ago for consistency reasons but it can be reintroduced in a consistent way in the future if needed. I've given the 'c' ones, but others have already blocked the use of them. Octal escape is allowed but a simple '0' or '0o' has the same problem as 0h or 0x ? Those of us still using 'c/c++' get used to the old standards. >>> > > 4. I'm assuming the stringy ints are rejected? >> > Source material may be 'stringy ints', so all that does is say "we can't >> > use the original variable it has to be converted" rather than we can and >> > use it's 'non-stringy' view. > Can you explain? I don't understand. I'm working with a 'variable' which may be an integer but that is only enforced by reference to how I am looking at it. I understand that some people want to ONLY allow it to be an integer and that may be the constraint added to it, but you may also need the string view, or the origin may be a string already, so one maintains both a binary view and a 'string' view of the same variable. So I don't subscribe to 'stringy ints' because all variables have a stringy element naturally. If I had any need for 'strict' constraints on a variable it has to cover both the size and type of the data, simply saying int is of little use if the data is too big anyway. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk