Re: Renaming "strict types" to "scalar type coercion"
On Tuesday, 18 June 2024 at 17:37, Robert Landers <[email protected]> wrote:
> Hello internals,
>
> [...]
>
> What are your thoughts?
As self-proclaimed leading expert on PHP type juggling.
That it is a terrible idea with no gains whatsoever.
Renaming the declare statement does not improve the situation.
> PS. Personally, I would rather unify non-strict and strict in some way
> that makes sense ... so, that route sounds nice too.
See my old meta RFC: https://github.com/Girgias/unify-typing-modes-rfc
It is a somewhat known hot take from mine that I think the strict_type declare statement was a
mistake. [1]
Mainly because it affects barely nothing in regard to the engine.
I have written/co-authored multiple RFCs over the years to make the default coercion mode less
whack. [2][3][4][5][6][7]
And my container/offset RFC is in the same vein [8] which lead me into a different rabbit hole then
the one I was expecting to explore which is addressing PHP's weird comparison semantics. [9]
Therefore, I would rather we focus on *actually* fixing PHP's semantics, than arguing about
changing the name of something that shouldn't really exist in the first place.
Best regards,
Gina P. Banyard
[1] Slide 68 of my PHP UK talk "PHP's Type System Dissected": https://gpb.moe/doc/slides/PHP_Type_System_Talk_PHPUK2023.pdf
[2] https://wiki.php.net/rfc/saner-numeric-strings
[3] https://wiki.php.net/rfc/implicit-float-int-deprecate
[4] https://wiki.php.net/rfc/saner-inc-dec-operators
[5] https://wiki.php.net/rfc/locale_independent_float_to_string
[6] https://wiki.php.net/rfc/exit-as-function
[7] https://wiki.php.net/rfc/deprecate-boolean-string-coercion
[8] https://github.com/Girgias/php-rfcs/blob/master/container-offset-behaviour.md
[9] https://github.com/Girgias/php-rfcs/blob/master/comparison-equality-semantics.md
Thread (28 messages)