From: Gina P. Banyard <intern...@gpb.moe>
Sent: Wednesday, June 19, 2024 5:08 PM
> 
> On Tuesday, 18 June 2024 at 17:37, Robert Landers
> <landers.rob...@gmail.com> 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.

Talking about 'going back in time' and sanitizing type coercion, I immediately 
had to think about the rejected 'Coercive Types for Function Arguments' RFC 
Zeev created as an alternative to the 'Scalar Type Declaration' RFC which was 
ultimately chosen and implemented.

https://wiki.php.net/rfc/coercive_sth

It seems that parts of what that RFC suggested have been implemented over time. 
In retrospect maybe this should have been the direction?

--
Vincent de Lau



> [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

Reply via email to