Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95048 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55278 invoked from network); 11 Aug 2016 20:44:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2016 20:44:09 -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.230 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.230 mail4-3.serversure.net Linux 2.6 Received: from [217.147.176.230] ([217.147.176.230:51034] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/24-25876-793ECA75 for ; Thu, 11 Aug 2016 16:44:08 -0400 Received: (qmail 26668 invoked by uid 89); 11 Aug 2016 20:44:05 -0000 Received: by simscan 1.3.1 ppid: 26661, pid: 26664, t: 0.0740s 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; 11 Aug 2016 20:44:05 -0000 To: internals@lists.php.net References: <10fbcb03-5de8-4d9a-da1c-7e2bf77937cb@lsces.co.uk> <5657afc7-7569-5fc4-4a5a-27ed786c4fa5@gmail.com> <0825c173-5cb4-7f65-cf34-b45ca30919a3@lsces.co.uk> <8646c3ad-b929-cb0b-bad4-52a0a7160d16@gmail.com> <11ce571b-964b-5a3e-9f2f-3f69a8bc20b4@lsces.co.uk> <21323ed4-47a6-902e-2ead-672630373b41@fleshgrinder.com> Message-ID: <3f9fb76d-8fa5-cf3c-45d4-7d9a9311f7fe@lsces.co.uk> Date: Thu, 11 Aug 2016 21:44:04 +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: <21323ed4-47a6-902e-2ead-672630373b41@fleshgrinder.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Simple variable handling. From: lester@lsces.co.uk (Lester Caine) On 11/08/16 21:22, Fleshgrinder wrote: > What you are describing are classes. You can achieve all of that with them. > > You are completely right btw. that exceptions should not be used during > validation and for flow control. We have said all along that all of this can be done in classes, and yes a variable is simply a small class. So why not create a generic variable which has all the current hard coded functions as well as the rules to carry out proper type management, secure escaping and machine readable attributes to allow IDE's and other external code to standardise handling them. I'm more than happy with docblock attributes and others have proposed alternate coding styles, but this IS simple if every variable is a well defined object? Even a simple 'int' variable is more than just a C word. It needs a much larger data packet with it's name and other settings, and adding range checking expands that packet. -- 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