Re: [RFC][DISCUSSION] Strong Typing Syntax

From: Date: Fri, 05 Jan 2018 09:50:16 +0000
Subject: Re: [RFC][DISCUSSION] Strong Typing Syntax
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-101541@lists.php.net to get a copy of this message
On 05/01/18 01:21, Rasmus Lerdorf wrote: > The reason we don’t have typed properties/variables is that it would require adding type > checks on almost every access to the underlying zval. That is a huge perf hit compared to only doing > it on method/function egress points as we do now. I think that in hindsight all I have been looking to out of this is that 'zval' has additional capability to standardise validation. 'Simply' adding a crude type check with it's overheads does not remove the validation requirements which still need to be handled much of the time. It the type check ALSO included validation, then the performance hit would be mitigated by the reduction in user side code. But 'error' may not be the right response EVEN with just the simple type check and that is why current typing hacks don't fit MY method of working. I have validation on key paths, but each is isolated from other paths while a core standard method of validation would simplify things in a way 'strong typing' does not! -- 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

« previous php.internals (#101541) next »