com php-src: Compare agaist fraction when sse are equal: ext/date/php_date.c
| From: | Derick Rethans | Date: | Fri, 29 Jan 2016 14:22:22 +0000 |
| Subject: | com php-src: Compare agaist fraction when sse are equal: ext/date/php_date.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90803@lists.php.net to get a copy of this message | ||
Commit: 58797219362e1ced60538adc0f1d9ed3a0b6da07
Author: Willem-Jan <wjzijderveld@gmail.com> Mon, 30 Nov 2015 14:58:02 +0100
Committer: Derick Rethans <github@derickrethans.nl> Fri, 29 Jan 2016 15:22:22 +0100
Parents: a0237259e9ffce19bb51c6cd340ce7df012b4f8c
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=58797219362e1ced60538adc0f1d9ed3a0b6da07
Log:
Compare agaist fraction when sse are equal
Changed paths:
M ext/date/php_date.c
Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 5ce1f72..45e77c3 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2195,8 +2195,16 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
if (!o2->time->sse_uptodate) {
timelib_update_ts(o2->time, o2->time->tz_info);
}
-
- return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse <
o2->time->sse) ? -1 : 1);
+
+ if (o1->time->sse == o2->time->sse) {
+ if (o1->time->f == o2->time->f) {
+ return 0;
+ }
+
+ return (o1->time->f < o2->time->f) ? -1 : 1;
+ }
+
+ return (o1->time->sse < o2->time->sse) ? -1 : 1;
}
static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_DC)