Re: [RFC][DISCUSSION] Strong Typing Syntax
| From: | Rasmus Lerdorf | Date: | Fri, 05 Jan 2018 01:21:09 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Strong Typing Syntax | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101537@lists.php.net to get a copy of this message | ||
> On Jan 4, 2018, at 13:09, Andreas Hennings <andreas@dqxtech.net> wrote:
>
> A system where all variables are type-locked could in fact be faster
> than a system with dynamically typed variables.
> Depends on the implementation, of course. I imagine it would be a lot
> of work to get there.
I think you, and many others, commenting here, should start by looking at the engine implementation.
Any successful RFC needs to have a strong implementation behind it, or at the very least a very
detailed description of how the implementation would mesh with the existing engine code.
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.
-Rasmus