Benjamin,


There’s a fundamental difference between the two RFCs that goes beyond
whether using a global INI setting and the other per-file setting.  The
fundamental difference is that the endgame of the Dual Mode RFC is having
two modes – and whatever syntax we’ll add, will be with us forever;  and in
the Coercive STH RFC – the endgame is a single mode with no INI entries,
and opening the door to changing the rest of PHP to be consistent with the
same rule-set as well (implicit casts).   The challenge with the Coercive
STH RFC is figuring out the best transition strategy, but the endgame is
superior IMHO.



Regarding the proposed migration options, yes, if we pick option #2 or #3 –
we’d be introducing an INI entry governing runtime behavior is something
nobody here wants, myself included – but given that it’ll be time limited
(perhaps for as short as 1 or 2 years) – perhaps that’s something we can
live with.



Additional options we could entertain are:

4. Not applying the rules for internal functions at all.  Personally I’m
not very fond of this option.

5. Go for just E_DEPRECATED in 7.0.  Change E_DEPRECATED to
E_RECOVERABLE_ERROR in 7.1/7.2/8.0 (TBD).

6. Same as #5, but also provide a mechanism similar to declare() as the
temporary measure for strict campers to explicitly ask for
E_RECOVERABLE_ERROR’s to be triggered.  They will no longer be necessary
when we change E_DEPRECATED to E_RECOVERABLE_ERROR in 7.1/7.2/8.0.



Thoughts?



Zeev



I was really looking forward to the RFC. However the dependence on an INI
setting and the question of massive internal BC break are a bit too much I
think.



They are necessary as you explain to allow internal functions/ZPP to have
the same conversion rules as userland functions. This INI setting is quite
similar to introducing two modes as well, but on the server configuration
level instead in a much more fine granular way in scalar type hints v0.5.



I see much more compatibility problems for third party libraries here.



Now if I had to decide between having two modes on a granular file level or
an INI setting (option 2/3) or massive BC breaks (option 1) to get scalar
type hints in PHP, then two modes with declare() doens't look, because I
can pick the mode I want, and no-one can force it on me.





Zeev

Reply via email to