RE: [PHP-DEV] [VOTE] Scalar Type Hints
| From: | Zeev Suraski | Date: | Thu, 12 Feb 2015 06:05:04 +0000 |
| Subject: | RE: [PHP-DEV] [VOTE] Scalar Type Hints | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-82513@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Sebastian B.-Hagensen [mailto:sbj.ml.read@gmail.com]
> Sent: Thursday, February 12, 2015 2:11 AM
> To: Zeev Suraski
> Cc: guilhermeblanco@gmail.com; Rasmus Lerdorf; PHP Internals
> Subject: Re: [PHP-DEV] [VOTE] Scalar Type Hints
>
> Hi,
>
> 2015-02-12 0:08 GMT+01:00 Zeev Suraski <zeev@zend.com>:
> > It gives the exact same
> > value from an API author’s point of view.
>
> But not from an api-consumers point of view.
I didn't claim otherwise. I am claiming that piece is significantly less
important, and that its negative implications outweigh its positive ones.
> Without either introducing a
> new set of casting/conversion rules or changing existing behavior
> (**exclusively**) 'weak' typehints may be perceived as seriously crippled..
> Maybe up to a point where the addition of them wouldn't be justified.
I argued we should tweak the conversion rules.
> > But unlike the current RFC, v0.1 doesn’t introduce an IMHO alien
> > concept into a language that considered dynamic typing to be a core
> > principle since its birth.
>
> It's not. PHP was always open to enforce strict typing in user created
> functions.
Being able to do something in custom code - and having language-level syntax
for it are a world a part in terms of condoned language principles. That's
why proponents of this RFC are so much in its favor - and opponents are so
much against. This new syntax would mean explosive growth and official
encouragement for developers to place strict type checking throughout their
code.
Zeev