Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95726 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87146 invoked from network); 7 Sep 2016 09:50:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2016 09:50:38 -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:41784] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/CA-18051-DE2EFC75 for ; Wed, 07 Sep 2016 05:50:37 -0400 Received: (qmail 24389 invoked by uid 89); 7 Sep 2016 09:50:34 -0000 Received: by simscan 1.3.1 ppid: 24383, pid: 24386, t: 0.0768s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 7 Sep 2016 09:50:34 -0000 To: internals@lists.php.net References: <232F1604-2211-4351-B830-EDC958A25D6D@strojny.net> <2de35db0-9974-cc96-83dd-3d2dbd48f7f8@lsces.co.uk> <5b72e9da-068a-bc79-82c2-f36f723f42bb@gmail.com> <819abe3a-5bfc-773a-025d-edfe92961a3a@lsces.co.uk> <3ac96216-51a9-305d-2500-083cb5905e5a@lsces.co.uk> <8bd021c1-47a6-280c-2db5-1a44788be2a3@lsces.co.uk> Message-ID: <931ed147-3e75-7f3c-2c14-6a1ff1ab51f1@lsces.co.uk> Date: Wed, 7 Sep 2016 10:50:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <8bd021c1-47a6-280c-2db5-1a44788be2a3@lsces.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][VOTE] Add validation functions to filter module From: lester@lsces.co.uk (Lester Caine) On 07/09/16 10:19, Lester Caine wrote: > If the definition of a variable is > improved to include ALL of the validation we ideally need and I include > setStrict(int) in that then at run time we can both validate input and > decide on the error model that is applied. And I know I will get my head chewed of for combining threads, but readOnly(); Seems to me the correct answer to the whole of the 'immutable' debate. The class simply creates a readOnly object, validated against all the rules and stores it as a readOnly object. No reason you can't simply call the class again and create a separate object. But this is where my 'model' of the world is an associative array set of data handled by a separate set of code. If you need 100 read only dates for a calendar you only need one set of code to generate them. The created objects would all be validated against the date rules and then locked so you can't modify them. -- 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