com php-src: Revert "Fixed bug #71053 (Type Hint about DateTime::diff does not match with informed)": NEWS ext/date/php_date.c ext/d
ate/tests/bug71053.phpt
| From: | Xinchen Hui | Date: | Wed, 09 Dec 2015 04:00:23 +0000 |
| Subject: | com php-src: Revert "Fixed bug #71053 (Type Hint about DateTime::diff does not match with informed)": NEWS ext/date/php_date.c ext/d ate/tests/bug71053.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90149@lists.php.net to get a copy of this message | ||
Commit: f248309b7485fea08e3c112adab97bfa1fc74df4
Author: Xinchen Hui <laruence@gmail.com> Wed, 9 Dec 2015 12:00:23 +0800
Parents: 943b23dcf6666a708c2ad4470cad5db36d47683a
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f248309b7485fea08e3c112adab97bfa1fc74df4
Log:
Revert "Fixed bug #71053 (Type Hint about DateTime::diff does not match with informed)"
THis is bc break, which will break $date1->diff($date2 , 1), which is
common used
please do not do bc break without a asking
This reverts commit 943b23dcf6666a708c2ad4470cad5db36d47683a.
Bugs:
https://bugs.php.net/71053
Changed paths:
M NEWS
M ext/date/php_date.c
D ext/date/tests/bug71053.phpt
Diff:
diff --git a/NEWS b/NEWS
index aae08f2..33bd38c 100644
--- a/NEWS
+++ b/NEWS
@@ -2,10 +2,6 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Jan 2016 PHP 7.0.2
-- Date:
- . Fixed bug #71053 (Type Hint about DateTime::diff does not match with
- informed). (Reeze Xia)
-
- Mbstring:
. Fixed bug #71066 (mb_send_mail: Program terminated with signal SIGSEGV,
Segmentation fault). (Laruence)
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index b3125a9..50c48eb 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -3579,9 +3579,9 @@ PHP_FUNCTION(date_diff)
zval *object1, *object2;
php_date_obj *dateobj1, *dateobj2;
php_interval_obj *interval;
- zend_bool absolute = 0;
+ zend_long absolute = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|b", &object1,
date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1,
date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = Z_PHPDATE_P(object1);
diff --git a/ext/date/tests/bug71053.phpt b/ext/date/tests/bug71053.phpt
deleted file mode 100644
index 2c86f9f..0000000
--- a/ext/date/tests/bug71053.phpt
+++ /dev/null
@@ -1,13 +0,0 @@
---TEST--
-Bug #71053 (Type Hint about DateTime::diff does not match with informed)
---FILE--
-<?php
-declare(strict_types=1);
-
-$date1 = new \DateTime();
-$date2 = clone $date1;
-
-var_dump(count($date1->diff($date2 , true)) > 0);
-?>
---EXPECT--
-bool(true)