diff options
| author | Florian MARGAINE <florian@margaine.com> | 2014-09-20 23:16:39 +0200 |
|---|---|---|
| committer | Derick Rethans <github@derickrethans.nl> | 2014-10-04 16:06:04 +0100 |
| commit | 9680829389aefc5bee2f0cdeacd34cbef6b66bbd (patch) | |
| tree | 402b5ea984c14331b78f81e3f06dda7fb8ea81e0 /ext/date/php_date.c | |
| parent | e32637782404201d05d0bcd9bb34b47d2b9fe3d4 (diff) | |
| download | php-git-9680829389aefc5bee2f0cdeacd34cbef6b66bbd.tar.gz | |
DateTimeZone::getOffset() now accepts a DateTimeInterface
Fixes #68062
Should be backported to PHP-5.6 and PHP-5.5.
Conflicts:
ext/date/tests/bug67118.phpt
Diffstat (limited to 'ext/date/php_date.c')
| -rw-r--r-- | ext/date/php_date.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 360c6d3f67..f2ced7bd59 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -325,12 +325,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_name_from_abbr, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2) - ZEND_ARG_INFO(0, object) - ZEND_ARG_INFO(0, datetime) + ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 0) + ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1) - ZEND_ARG_INFO(0, datetime) + ZEND_ARG_INFO(0, object) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1) @@ -3799,7 +3799,7 @@ PHP_FUNCTION(timezone_name_from_abbr) } /* }}} */ -/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object) +/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface datetime) Returns the timezone offset. */ PHP_FUNCTION(timezone_offset_get) @@ -3809,13 +3809,13 @@ PHP_FUNCTION(timezone_offset_get) php_date_obj *dateobj; timelib_time_offset *offset; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) { RETURN_FALSE; } tzobj = Z_PHPTIMEZONE_P(object); DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); dateobj = Z_PHPDATE_P(dateobject); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); + DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface); switch (tzobj->type) { case TIMELIB_ZONETYPE_ID: |
