From 58797219362e1ced60538adc0f1d9ed3a0b6da07 Mon Sep 17 00:00:00 2001 From: Willem-Jan Date: Mon, 30 Nov 2015 14:58:02 +0100 Subject: [PATCH] Compare agaist fraction when sse are equal --- ext/date/php_date.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 5ce1f7262c..45e77c38a2 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) -- 2.40.0