Re: [RFC] Scalar Type Hints
| From: | Andrea Faulds | Date: | Sat, 03 Jan 2015 18:05:25 +0000 |
| Subject: | Re: [RFC] Scalar Type Hints | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80121@lists.php.net to get a copy of this message | ||
Hey Pierre,
> Thanks, great work and persistent effort!
Thank you.
> As I am also slightly in favor of a strict way, this RFC is a good compromise.
>
> Some comments:
>
> - on-numeric strings not accepted. Numeric strings with trailing
> characters are accepted, but produce a notice.
>
> I would rather not allow fancy conversions here. Any trailing non
> white spaces characters should not be allowed. I know it is not what
> PHP does now in some cases but this is really a fuzzy area and never
> really matched any actual needs or usages.
Yeah, I don’t like this behaviour much. I want to avoid inconsistency with the behaviour of
extension functions (i.e. zend_parse_parameters) where possible, though. Since this has come up so
much, I should probably make an RFC to change this aspect of ZPP’s behaviour.
> I am also not a fan of errors, exception, at least for methods, make
> much more sense. I know it is relatively easy to handle errors as
> exception but still, let do it right now.
That’s be inconsistent with our other type hints. To get this changed, I think we’ll just have
to wait for Nikita’s Exceptions in the Engine for PHP 7 RFC.
Thanks.
--
Andrea Faulds
http://ajf.me/