com php-src: DateTimeZone::getOffset() now accepts a DateTimeInterface: ext/date/php_date.c ext/date/tests/68062.phpt
ext/date/tests/DateTimeZone_getOffset_variation1.php t ext/date/tests/timezone_offset_get_error.phpt ext
/date/tests/timezone_offset_get_variation2.phpt
| From: | Derick Rethans | Date: | Sat, 04 Oct 2014 14:58:24 +0000 |
| Subject: | com php-src: DateTimeZone::getOffset() now accepts a DateTimeInterface: ext/date/php_date.c ext/date/tests/68062.phpt ext/date/tests/DateTimeZone_getOffset_variation1.php t ext/date/tests/timezone_offset_get_error.phpt ext /date/tests/timezone_offset_get_variation2.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82093@lists.php.net to get a copy of this message | ||
Commit: 046c345de508dff769cfcf4a448a4a5a4f009294
Author: Florian MARGAINE <florian@margaine.com> Mon, 22 Sep 2014 23:35:29 +0200
Committer: Derick Rethans <github@derickrethans.nl> Sat, 4 Oct 2014 15:58:24 +0100
Parents: 0407bdf252004cce08e383bc0f4aa0bbc69c9a25
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=046c345de508dff769cfcf4a448a4a5a4f009294
Log:
DateTimeZone::getOffset() now accepts a DateTimeInterface
Fixes #68062
Bugs:
https://bugs.php.net/68062
Changed paths:
M ext/date/php_date.c
A ext/date/tests/68062.phpt
M ext/date/tests/DateTimeZone_getOffset_variation1.phpt
M ext/date/tests/timezone_offset_get_error.phpt
M ext/date/tests/timezone_offset_get_variation2.phpt
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 92e9480..bbfd9b6 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -326,7 +326,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2) 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) @@ -3341,7 +3341,7 @@ PHP_FUNCTION(timezone_name_from_abbr) } /* }}} */ -/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object) +/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface object) Returns the timezone offset. */ PHP_FUNCTION(timezone_offset_get) @@ -3351,13 +3351,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 = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); + DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface); switch (tzobj->type) { case TIMELIB_ZONETYPE_ID: diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt new file mode 100644 index 0000000..ce2105a --- /dev/null +++ b/ext/date/tests/68062.phpt @@ -0,0 +1,13 @@ +--TEST-- +DateTimeZone::getOffset() accepts a DateTimeInterface object +--FILE-- +<?php + +$tz = new DateTimeZone('Europe/London'); +$dt = new DateTimeImmutable('2014-09-20', $tz); + +echo $tz->getOffset($dt); +echo $tz->getOffset(1); +--EXPECTF-- +3600 +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt index a86d5e1..ecd99d5 100644 --- a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt +++ b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index b8ca2c1..c9fa25c 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -73,12 +73,12 @@ bool(false) -- Testing timezone_offset_get() function with an invalid values for $datetime argument -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_variation2.phpt b/ext/date/tests/timezone_offset_get_variation2.phpt index 93311f3..c83b697 100644 --- a/ext/date/tests/timezone_offset_get_variation2.phpt +++ b/ext/date/tests/timezone_offset_get_variation2.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE===
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 92e9480..bbfd9b6 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -326,7 +326,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2) 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) @@ -3341,7 +3341,7 @@ PHP_FUNCTION(timezone_name_from_abbr) } /* }}} */ -/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object) +/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface object) Returns the timezone offset. */ PHP_FUNCTION(timezone_offset_get) @@ -3351,13 +3351,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 = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); + DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface); switch (tzobj->type) { case TIMELIB_ZONETYPE_ID: diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt new file mode 100644 index 0000000..ce2105a --- /dev/null +++ b/ext/date/tests/68062.phpt @@ -0,0 +1,13 @@ +--TEST-- +DateTimeZone::getOffset() accepts a DateTimeInterface object +--FILE-- +<?php + +$tz = new DateTimeZone('Europe/London'); +$dt = new DateTimeImmutable('2014-09-20', $tz); + +echo $tz->getOffset($dt); +echo $tz->getOffset(1); +--EXPECTF-- +3600 +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt index a86d5e1..ecd99d5 100644 --- a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt +++ b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index b8ca2c1..c9fa25c 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -73,12 +73,12 @@ bool(false) -- Testing timezone_offset_get() function with an invalid values for $datetime argument -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_variation2.phpt b/ext/date/tests/timezone_offset_get_variation2.phpt index 93311f3..c83b697 100644 --- a/ext/date/tests/timezone_offset_get_variation2.phpt +++ b/ext/date/tests/timezone_offset_get_variation2.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d +Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE===