Bug #71053 [ReO->Csd]: Type Hint about DateTime::diff does not match with informed

From: Date: Sun, 13 Dec 2015 08:24:12 +0000
Subject: Bug #71053 [ReO->Csd]: Type Hint about DateTime::diff does not match with informed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197845@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71053&edit=1 ID: 71053 Updated by: laruence@php.net Reported by: gabriel dot heming at hotmail dot com Summary: Type Hint about DateTime::diff does not match with informed -Status: Re-Opened +Status: Closed Type: Bug Package: Date/time related Operating System: Debian 8.2 PHP Version: 7.0.0 Assigned To: laruence Block user comment: N Private report: N New Comment: fix has been committed in https://github.com/php/php-src/commit/4171a8f6c631e3c34d1d070d553e7611b5474263 and some doc bugs also be reported in #71107 Previous Comments: ------------------------------------------------------------------------ [2015-12-10 00:53:29] laruence@php.net okey, let me think about a whole fix way. maybe depends on parsing the doc repo ------------------------------------------------------------------------ [2015-12-09 16:13:25] nikic@php.net @laruence: Reflection does not provide type info for nearly all internal functions. That's not a reason for not fixing zpp type specs. Imho this is a bug fix and it's better to do it earlier than later, otherwise people using strict_types will start relying on it. ------------------------------------------------------------------------ [2015-12-09 16:06:55] gabriel dot heming at hotmail dot com @laruance by my interpretation, "safe" not means "correct". If we can report bugs (to me, this mismatch type is a bug), fix could create some BC and BC is not the safe way, why the reason we must report bugs? ------------------------------------------------------------------------ [2015-12-09 15:17:30] laruence@php.net @salathe , it's not a simple fix that change l to b. internal functions are lots of mis-set type in parse parameters. and it even dones't have refelction supports, if you try to reflects the paramters , and get the type of it , it returns NULL. is that also need to be fixed? so, only fix this part means nothing. and I agree that this is a 'bug', but I'd prefer to do the whole fix only in master. and considering of this will leads people wrongly. change doc instead of change codes seems more safe for me. thanks ------------------------------------------------------------------------ [2015-12-09 15:01:44] salathe@php.net This is not a documentation bug. The source code should stipulate boolean for the $absolute parameter. That is the correct type given the a) documentation, b) prototype in the source, c) the use of the argument in the source. If fixing the type breaks existing old (incorrect with strict types) code using a value of 1 for the argument, so be it. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=71053 -- Edit this bug report at https://bugs.php.net/bug.php?id=71053&edit=1

« previous php.bugs (#197845) next »