Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96907 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96477 invoked from network); 16 Nov 2016 08:19:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Nov 2016 08:19:43 -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 185.153.204.204 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 185.153.204.204 mail4.serversure.net Linux 2.6 Received: from [185.153.204.204] ([185.153.204.204:55359] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/1A-05303-C961C285 for ; Wed, 16 Nov 2016 03:19:42 -0500 Received: (qmail 7573 invoked by uid 89); 16 Nov 2016 08:19:37 -0000 Received: by simscan 1.3.1 ppid: 7566, pid: 7569, t: 0.0472s 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; 16 Nov 2016 08:19:37 -0000 To: internals@lists.php.net References: Message-ID: Date: Wed, 16 Nov 2016 08:19:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Type locked variables From: lester@lsces.co.uk (Lester Caine) On 16/11/16 00:06, Guy Marriott wrote: > I think it would make more sense for typed properties to exist first, and > it so happens that there was a recent RFC for this: > https://wiki.php.net/rfc/typed-properties. That RFC failed by a very small > margin. > > I would suggest you read through the discussions on the mailing list > regarding that RFC for some common arguments to typing in PHP. It really does feel that it's time for a complete split between the simplicity that PHP has traditionally provided by NOT requiring everything is tied down in the straight jacket of 'strict typing' and a version of PHP that only works for that style of user. Things like 'function overloading' and 'int $b = 5;' do not simplify anything if you are using PHP to get away from the 'annoyance' of having to worry just how '5' was supplied. That it is an integer is only a small part of verifying if it is actually a valid input and handling mistakes or even hack attempts are not solved by simply throwing out of line errors due to a different style of working. Simply adding a range check on an input keeps the fault in the right place and perhaps allows 'five' to be responded to with a correct response ... What is STILL needed even if you make PHP only strict is a proper validation of the data contained in those 'restricted' pots ... and I include validation that an in variable is 8, 16, 32, 64 and today even bigger which is where the need for strict typing originated, and function overload to handle a multiple of fixed variable sizes. -- 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