Re: [RFC] Optional typehint check for parameters
| From: | Rowan Collins | Date: | Tue, 17 Jul 2018 08:30:13 +0000 |
| Subject: | Re: [RFC] Optional typehint check for parameters | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-102880@lists.php.net to get a copy of this message | ||
On 16 July 2018 at 19:17, Larry Garfield <larry@garfieldtech.com> wrote:
> It sounds like your main argument for why to even bother with this is
> performance. I think you're greatly over-estimating the performance
> impact of
> type checking. I wager if you just cache a few database lookups and
> you'll
> get a much larger performance win. For far, far less effort and confusion.
>
That's true of *current* type hints, but performance has absolutely been
cited as a reason not to introduce additional features, such as typed
arrays (e.g. int[] $foo or array<int,int> $foo). I think that's the
motivation here, rather than optimizing existing code.
Regards,
--
Rowan Collins
[IMSoP]