> Le 27 avr. 2023 à 23:28, Máté Kocsis <kocsismat...@gmail.com> a écrit :
> 
> Hi Internals,
> 
> As you have possibly already experienced, overloaded signatures cause
> various smaller and bigger issues, while the concept is not natively
> supported by PHP. That's why I drafted an RFC which intends to phase out
> the majority of overloaded function/method signatures and also forbid
> the introduction of such functions in the future:
> https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures
> 
> 

Hi Máté,

The replacement methods for IntlCalendar::set() (namely IntlCalendar::setDate() 
and IntlCalendar::setDateTime()) must not have a return type of `void`, but 
`true`, like the original method, for the two following reasons:

1. By changing the returned value, you are introducing an unnecessary hazard 
when migrating code.

2. Per https://www.php.net/IntlCalendar, all modification methods of that class 
(clear(), roll(), setTime(), etc.) consistently return `true` on success and 
`false` on failure, even when the method is infallible (and thus would always 
return `true`). Don’t break consistency.

—Claude


Reply via email to