Bug #73301 [Opn->Nab]: DateTime::setTime breaks backwards compatibility

From: Date: Wed, 12 Oct 2016 13:25:25 +0000
Subject: Bug #73301 [Opn->Nab]: DateTime::setTime breaks backwards compatibility
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204634@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 Updated by: derick@php.net Reported by: sjon at hortensius dot net Summary: DateTime::setTime breaks backwards compatibility -Status: Open +Status: Not a bug Type: Bug Package: Date/time related PHP Version: 7.1Git-2016-10-12 (Git) Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php This works as it supposed to be. There were no changes to the original defaults. This addition was part of supporting, and fixing, microtime support across the board. Previous Comments: ------------------------------------------------------------------------ [2016-10-12 12:37:31] sjon at hortensius dot net 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#204634) next »