PHP Scalar Type Hints, Follow-up


The vote for the RFC “PHP Scalar Type Hints” got cancelled, after the author of the RFC – Andrea Faulds – posted “I Quit” on the internals list:

For my own reasons, I have decided to cease my involvement with PHP development. […] I’m no longer contributing to PHP, and all four active RFCs authored by myself are therefore withdrawn: Scalar Type Hints, Spaceship/Combined Comparison Operator, Void Return Type, Big Integer Support.

Very sad, yet it’s a choice one must respect.

Whilst the vote still was open, my eye fell on “Do NOT work around weak typehints, but fix them” by Bob Weinand, who voted “no”. His conclusion read:

[…] I voted no on the RFC. Not because it is a bad RFC nor a bad concept, it just tries to fix the problem the wrong way. It is a workaround around the too relax current type casting, which basically is the root problem to should be solved.

I think, working around the core problem is definitely not the way to go. Fix the core problem, then we don’t need strict scalar hints (as weak hints already will cover everything strict hints aim to solve) and unicorns stop dying so fast.

As someone who’s not familiar with how the voting system in the PHP community actually works this got me wondering why Bob’s argumentation made wasn’t noted somewhere along the RFC before the vote started. It’s a very reasonable argumentation, with some good points.

Now, whilst I do dig the gist of the RFC I wasn’t a fan of the suggested declare(strict_types=1) { … } myself either. If I were to vote on the RFC, it would have resulted in a “no” too, even though I like the essence of it. What seems to be missing on the vote is a “no, but …” (or even “yes, but …”) option, for people like Bob and me.

Getting lots of “no” votes is not pleasant, yet – when looking at the results of the ternary vote – I do suspect quite a few of those were more “no, but …” votes …

Perhaps there were too little possible options to vote for? Or perhaps the vote was opened too soon?

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.