]> granicus.if.org Git - php/commitdiff
Compare agaist fraction when sse are equal
authorWillem-Jan <wjzijderveld@gmail.com>
Mon, 30 Nov 2015 13:58:02 +0000 (14:58 +0100)
committerDerick Rethans <github@derickrethans.nl>
Fri, 29 Jan 2016 14:22:22 +0000 (15:22 +0100)
ext/date/php_date.c

index 5ce1f7262c02db956612eae6f28d27fe3f628047..45e77c38a2e3b9cc89b9ab072171b5970e73a844 100644 (file)
@@ -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)