Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68002 invoked from network); 12 May 2015 20:32:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2015 20:32:41 -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:47936] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/15-41925-76362555 for ; Tue, 12 May 2015 16:32:40 -0400 Received: (qmail 17072 invoked by uid 89); 12 May 2015 20:32:36 -0000 Received: by simscan 1.3.1 ppid: 17064, pid: 17069, t: 0.1634s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 12 May 2015 20:32:36 -0000 Message-ID: <55526363.1090105@lsces.co.uk> Date: Tue, 12 May 2015 21:32:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: PHP internals References: <5552540C.9000205@lsces.co.uk> <1C9DBFFC-7B6D-470B-B706-7A6B0938C67A@gmail.com> In-Reply-To: <1C9DBFFC-7B6D-470B-B706-7A6B0938C67A@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] is_digits() and digits type From: lester@lsces.co.uk (Lester Caine) On 12/05/15 20:57, Rowan Collins wrote: > Type hints are not intended for validating data that is entering or leaving PHP from or to other systems, they are only relevant when passing data from one part of a PHP system to another. On any given install of PHP, two libraries communicating with each other by function calls will agree on a definition of "int", because they are in the same process, and that is all that is needed for an "int" type hint to be meaningful. I think that perhaps this is a key point that needs to be fully documented before PHP7 is released. That type hints are essentially NOT to be used for data validation may not be obvious to many who are planning to 'convert' to using them? However I still don't see how one one can handle data handed over internally without also providing a mechanism to ensure the right range of value is maintained through the system. If a library produces results that are out of range of the target channel then simply establishing that it's a valid number is of limited use. It IS the handling of data validation as a central service that is needed, and why would one not then use that for the internal data handling as well? -- 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