Re: [RFC] [Discussion] Deprecate functions with overloaded signatures
| From: | Derick Rethans | Date: | Fri, 05 May 2023 16:12:48 +0000 |
| Subject: | Re: [RFC] [Discussion] Deprecate functions with overloaded signatures | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120197@lists.php.net to get a copy of this message | ||
On Thu, 27 Apr 2023, Máté Kocsis wrote:
> 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:
> \*.zéÄæOneî†
> Öhttps://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures
I'm going to nitpick on the newly suggested names and argument order for the
DatePeriod factory methods — althoughI do agree that they need to get created:
createFromInterval(DateTimeInterface $start, DateInterval $interval, DateTimeInterface $end, int
$options = 0)
→ createWithRange(DateTimeInterface $begin, DateTimeInterface $end, DateTimeInterface $int, int
$options = 0)
createFromRecurrences(DateTimeInterface $start, DateInterval $interval, int $recurrences, int
$options = 0)
→ createWithRecurrences(DateInterval $begin, int $recurrences, DateInterval $interval, int
$options = 0)
We also should fix the argument names. Either $start/$finish, or $begin/$end. I
prefer the latter.
createFromIso8601(string $specification, int $options = 0)
-> createFromISO8601String
I am open to bike shedding about this :-)
cheers,
Derick