summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2016-01-29 15:28:11 +0100
committerDerick Rethans <github@derickrethans.nl>2016-01-29 15:28:11 +0100
commit1a8682568834580b44c448f2e682c704eea626d4 (patch)
tree5c454def0c616e2412090c4d871b60c86a9910d6
parent2aeef4e5390344115391607792dbf8b94b3ec459 (diff)
downloadphp-git-1a8682568834580b44c448f2e682c704eea626d4.tar.gz
Use the new timelib function for comparing times
-rw-r--r--ext/date/php_date.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 4ef954717d..d5d06f6b27 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2196,19 +2196,7 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
timelib_update_ts(o2->time, o2->time->tz_info);
}
- if (o1->time->sse == o2->time->sse) {
- if (o1->time->f == o2->time->f) {
- return 0;
- }
-
- if (o1->time->sse < 0) {
- return (o1->time->f < o2->time->f) ? 1 : -1;
- } else {
- return (o1->time->f < o2->time->f) ? -1 : 1;
- }
- }
-
- return (o1->time->sse < o2->time->sse) ? -1 : 1;
+ return timelib_time_compare(o1->time, o2->time);
}
static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_DC)