Bug #73301 [Opn]: DateTime::setTime breaks backwards compatibility
| From: | sjon at hortensius dot net | Date: | Wed, 12 Oct 2016 12:37:32 +0000 |
| Subject: | Bug #73301 [Opn]: DateTime::setTime breaks backwards compatibility | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204633@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73301&edit=1
ID: 73301
User updated by: sjon at hortensius dot net
Reported by: sjon at hortensius dot net
Summary: DateTime::setTime breaks backwards compatibility
Status: Open
Type: Bug
Package: Date/time related
PHP Version: 7.1Git-2016-10-12 (Git)
Block user comment: N
Private report: N
New Comment:
Ah, right; I was thrown off by the Exception message. It's nice functionality; and I'm not
saying DateTime::setMicroTime would be better; but I'm also not sure about the timing of this
feature.
Apparently quite a few issues were fixed by introducing this @ https://github.com/php/php-src/commit/55626549d81d0feadb1d160be78fcf2b898a48cc#diff-7b738accc3d60f74c259da18588ddc5d
Previous Comments:
------------------------------------------------------------------------
[2016-10-12 12:22:58] nikic@php.net
This is not related to the default value (which has not changed). We generally do not allow removing
parameters, even optional ones, from method signatures: https://3v4l.org/i1Btt
------------------------------------------------------------------------
[2016-10-12 11:53:11] sjon at hortensius dot net
Description:
------------
DateTime::setTime was changed between RC3 and RC4 in a backward breaking way which seems highly
unwanted.
Warning: Declaration of Custom_DateTime::setTime($hour, $minute, $second = 0) should be compatible
with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL)
This causes applications to break; why was $second=0 not kept as a default?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73301&edit=1