Re: [VOTE] Scalar Type Hints

From: Date: Fri, 13 Feb 2015 09:37:48 +0000
Subject: Re: [VOTE] Scalar Type Hints
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Le Thu Feb 05 2015 at 21:15:45, Andrea Faulds <[email protected]> a écrit :

Good evening,
>
> At long last, I’m going to put the RFC to a vote. It’s been long enough -
> I don’t think there needs to be, or will be, much further discussion.
>
> I’d like to make sure that everyone voting understands the RFC fully.
> Please read the RFC in full: the details are important. And if  anyone has
> any questions or uncertainties, please ask them before voting. I am very
> happy to answer them.
>
> I would urge everyone who wants type hints to vote for this RFC. It is not
> a perfect solution, but there can be no perfect solution to this issue.
> However, I think it is better than most of the alternatives suggested thus
> far - see the rationale section, and previous discussions. Crucially, this
> RFC would keep PHP a weakly-typed language, and not force either strict
> typing, nor weak typing, on anyone who does not want it. It would allow the
> addition of type hints to existing codebases. It would not create a
> situation where userland functions are strict yet internal functions are
> not, because the strict mode affects both. I’ve tested the implementation
> myself on my own code, and it worked well, providing benefits other
> proposals would not have given (see my previous post about my experiences).
>
> Voting starts today (2015-02-05) and ends in two weeks’ time (2015-02-19).
> In addition to the vote on the main RFC, there is also a vote on the type
> aliases issue, and a vote to reserve the type names for future RFCs’ sake
> if this RFC fails.
>
> The RFC can be found here, and it contains a voting widget:
> https://wiki.php.net/rfc/scalar_type_hints
>
> Thank you for your time.
>
> --
> Andrea Faulds
> http://ajf.me/
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Voted "no" because of the reasons already mentioned by a bunch of others
here.

Weak type hint as presented earlier: +1 (and very good job Andrea about
that!).
declare(strict_types=1): -1, not only about the syntax, but also about the
mixed mode it introduces.

I'm pretty confident that this RFC will "pass" with just above 2/3 of
majority while it could reach much more.

 I am pretty sure that if this RFC doesn't include a strict type mode _the
way it is proposed_ (or even, not at all, as part of another related RFC),
it would have some "no" converted to "yes" and would have a wider adoption,
which is for sure a better option than relying on a voting mechanism which
still is a supporting tool, we're not politicians after all :)

Andi's suggestion about an E_STRICT_TYPES sounds very reasonable and much
more in line with how PHP deals with "errors". However, I think this should
be discussed separately as this is really about the A + B think that Zeev
was talking about.

Cheers,
Patrick


Thread (187 messages)

« previous php.internals (#82589) next »