Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86185 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76649 invoked from network); 12 May 2015 22:14:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 May 2015 22:14:08 -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:45289] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/56-41925-F2B72555 for ; Tue, 12 May 2015 18:14:08 -0400 Received: (qmail 24919 invoked by uid 89); 12 May 2015 22:14:04 -0000 Received: by simscan 1.3.1 ppid: 24912, pid: 24915, t: 0.1305s 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 22:14:04 -0000 Message-ID: <55527B2A.6010506@lsces.co.uk> Date: Tue, 12 May 2015 23:14:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: internals@lists.php.net References: <5552540C.9000205@lsces.co.uk> <1C9DBFFC-7B6D-470B-B706-7A6B0938C67A@gmail.com> <55526363.1090105@lsces.co.uk> In-Reply-To: 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 22:38, Rowan Collins wrote: > On 12 May 2015 22:32:55 BST, Rowan Collins wrote: >> >It is already possible to pass around, and type hint for, any class of >> >object, so you could for instance have a DatabaseID class. PHP's lack >> >of operator overloading makes that less appealing, perhaps, but it >> >would work. > Incidentally, it's still not the type hint that's performing validation here - that would go in the constructor of the object, I guess. Rather, the type hint holds the promise that the validation has already happened somewhere else. That most good libraries already have the validation code is my point here. Either the variable has already been validated, so the type hint is not relevant. OR the data still needs validating in which case only 'string' is now usable? With any pre-processing now requiring a switch back to string ... this is where I'm having problems seeing how if someone switches a library to using strict type hinting internally that will not have an impact on using the same library as it is currently being used without type hinting. -- 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