Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83070 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35026 invoked from network); 18 Feb 2015 14:41:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 14:41:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; 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:57644] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/84-18888-D74A4E45 for ; Wed, 18 Feb 2015 09:41:07 -0500 Received: (qmail 16191 invoked by uid 89); 18 Feb 2015 14:40:57 -0000 Received: by simscan 1.3.1 ppid: 16185, pid: 16188, t: 0.0761s 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; 18 Feb 2015 14:40:57 -0000 Message-ID: <54E4A479.6060006@lsces.co.uk> Date: Wed, 18 Feb 2015 14:40:57 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <54E3E27B.2010903@lerdorf.com> <2f99c47df51fa6c73131032ec50fade0@mail.gmail.com> <54E46171.3010805@lsces.co.uk> <030a01d04b77$0ff43b40$2fdcb1c0$@php.net> In-Reply-To: <030a01d04b77$0ff43b40$2fdcb1c0$@php.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Scalar Type Hints v0.4 From: lester@lsces.co.uk (Lester Caine) On 18/02/15 12:33, François Laupretre wrote: >> Octal is something that can often be miss converted since it IS the same >> > as an integer with only a '0' in front in PHP. But that is not something >> > that can be fixed with the current proposals? > What do you propose ? Considering leading zero as octal indicator is not an option, IMO. If you have another way, why not. 0o 0 and \ are the usual flags for an octal value and we have functions for octal strings but they are not user friendly in their output as they tend to ignore adding a leading tag at all. But my favourite is still '\143\141\164' == "\143\141\164" which is false, but I doubt many would know why? Yes it only becomes a problem when one is accessing material like historic data dumps, and rejecting the numeric string may be 'strictly' correct, but it's one those 'what the' if one gets an error where for years it's run perfectly? >> > Again we have to ensure >> > that the pre-processing takes care of the problem and how would static >> > analysis even know there was a problem? A type hint following the SQL >> > standards. > Please give conversion rules and supported syntax for the 'SQL' type you have in mind. 'octal' just expects a base 8 string. I know there are some examples in the SQL standards, but since they are paid for documents it's pointless trying to reference them :( ( Andrey - there may not be plans to support a full range of hints - weak or strict, but this is all valid material that PHP handles daily and passes around ) -- 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