From: Willem-Jan Date: Mon, 30 Nov 2015 13:58:02 +0000 (+0100) Subject: Compare agaist fraction when sse are equal X-Git-Tag: php-7.0.4RC1~20^2~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58797219362e1ced60538adc0f1d9ed3a0b6da07;p=php Compare agaist fraction when sse are equal --- 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)