Skip to content

Instantly share code, notes, and snippets.

@krakjoe
Created July 21, 2015 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krakjoe/9e154f7196b30d868b46 to your computer and use it in GitHub Desktop.
Save krakjoe/9e154f7196b30d868b46 to your computer and use it in GitHub Desktop.
DateTimeAbstract
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 2f52353..930c9f1 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -326,7 +326,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 0)
- ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0)
+ ZEND_ARG_OBJ_INFO(0, datetime, DateTimeAbstract, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1)
@@ -453,12 +453,12 @@ const zend_function_entry date_functions[] = {
};
static const zend_function_entry date_funcs_interface[] = {
- PHP_ABSTRACT_ME(DateTimeInterface, format, arginfo_date_method_format)
- PHP_ABSTRACT_ME(DateTimeInterface, getTimezone, arginfo_date_method_timezone_get)
- PHP_ABSTRACT_ME(DateTimeInterface, getOffset, arginfo_date_method_offset_get)
- PHP_ABSTRACT_ME(DateTimeInterface, getTimestamp, arginfo_date_method_timestamp_get)
- PHP_ABSTRACT_ME(DateTimeInterface, diff, arginfo_date_method_diff)
- PHP_ABSTRACT_ME(DateTimeInterface, __wakeup, NULL)
+ PHP_ABSTRACT_ME(DateTimeAbstract, format, arginfo_date_method_format)
+ PHP_ABSTRACT_ME(DateTimeAbstract, getTimezone, arginfo_date_method_timezone_get)
+ PHP_ABSTRACT_ME(DateTimeAbstract, getOffset, arginfo_date_method_offset_get)
+ PHP_ABSTRACT_ME(DateTimeAbstract, getTimestamp, arginfo_date_method_timestamp_get)
+ PHP_ABSTRACT_ME(DateTimeAbstract, diff, arginfo_date_method_diff)
+ PHP_ABSTRACT_ME(DateTimeAbstract, __wakeup, NULL)
PHP_FE_END
};
@@ -572,7 +572,7 @@ PHP_INI_END()
/* }}} */
zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period;
-zend_class_entry *date_ce_immutable, *date_ce_interface;
+zend_class_entry *date_ce_immutable, *date_ce_abstract;
PHPAPI zend_class_entry *php_date_get_date_ce(void)
@@ -1958,29 +1958,16 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval
return (zend_object_iterator*)iterator;
} /* }}} */
-static int implement_date_interface_handler(zend_class_entry *interface, zend_class_entry *implementor) /* {{{ */
-{
- if (implementor->type == ZEND_USER_CLASS &&
- !instanceof_function(implementor, date_ce_date) &&
- !instanceof_function(implementor, date_ce_immutable)
- ) {
- zend_error(E_ERROR, "DateTimeInterface can't be implemented by user classes");
- }
-
- return SUCCESS;
-} /* }}} */
-
static void date_register_classes(void) /* {{{ */
{
- zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface;
+ zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_abstract;
- INIT_CLASS_ENTRY(ce_interface, "DateTimeInterface", date_funcs_interface);
- date_ce_interface = zend_register_internal_interface(&ce_interface);
- date_ce_interface->interface_gets_implemented = implement_date_interface_handler;
+ INIT_CLASS_ENTRY(ce_abstract, "DateTimeAbstract", date_funcs_interface);
+ date_ce_abstract = zend_register_internal_class(&ce_abstract);
+ date_ce_abstract->create_object = date_object_new_date;
INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date);
- ce_date.create_object = date_object_new_date;
- date_ce_date = zend_register_internal_class_ex(&ce_date, NULL);
+ date_ce_date = zend_register_internal_class_ex(&ce_date, date_ce_abstract);
memcpy(&date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_date.offset = XtOffsetOf(php_date_obj, std);
date_object_handlers_date.free_obj = date_object_free_storage_date;
@@ -1988,7 +1975,6 @@ static void date_register_classes(void) /* {{{ */
date_object_handlers_date.compare_objects = date_object_compare_date;
date_object_handlers_date.get_properties = date_object_get_properties;
date_object_handlers_date.get_gc = date_object_get_gc;
- zend_class_implements(date_ce_date, 1, date_ce_interface);
#define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1);
@@ -2007,13 +1993,11 @@ static void date_register_classes(void) /* {{{ */
REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339);
INIT_CLASS_ENTRY(ce_immutable, "DateTimeImmutable", date_funcs_immutable);
- ce_immutable.create_object = date_object_new_date;
- date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, NULL);
+ date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, date_ce_abstract);
memcpy(&date_object_handlers_immutable, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_immutable.clone_obj = date_object_clone_date;
date_object_handlers_immutable.compare_objects = date_object_compare_date;
date_object_handlers_immutable.get_properties = date_object_get_properties;
- zend_class_implements(date_ce_immutable, 1, date_ce_interface);
INIT_CLASS_ENTRY(ce_timezone, "DateTimeZone", date_funcs_timezone);
ce_timezone.create_object = date_object_new_timezone;
@@ -2977,7 +2961,7 @@ PHP_FUNCTION(date_parse_from_format)
}
/* }}} */
-/* {{{ proto string date_format(DateTimeInterface object, string format)
+/* {{{ proto string date_format(DateTimeAbstract object, string format)
Returns date formatted according to given format
*/
PHP_FUNCTION(date_format)
@@ -2987,7 +2971,7 @@ PHP_FUNCTION(date_format)
char *format;
size_t format_len;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_abstract, &format, &format_len) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3228,7 +3212,7 @@ static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, timelib_time
}
-/* {{{ proto DateTimeZone date_timezone_get(DateTimeInterface object)
+/* {{{ proto DateTimeZone date_timezone_get(DateTimeAbstract object)
Return new DateTimeZone object relative to give DateTime
*/
PHP_FUNCTION(date_timezone_get)
@@ -3237,7 +3221,7 @@ PHP_FUNCTION(date_timezone_get)
php_date_obj *dateobj;
php_timezone_obj *tzobj;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_abstract) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3312,7 +3296,7 @@ PHP_METHOD(DateTimeImmutable, setTimezone)
}
/* }}} */
-/* {{{ proto long date_offset_get(DateTimeInterface object)
+/* {{{ proto long date_offset_get(DateTimeAbstract object)
Returns the DST offset.
*/
PHP_FUNCTION(date_offset_get)
@@ -3321,7 +3305,7 @@ PHP_FUNCTION(date_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_abstract) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3545,7 +3529,7 @@ PHP_METHOD(DateTimeImmutable, setTimestamp)
}
/* }}} */
-/* {{{ proto long date_timestamp_get(DateTimeInterface object)
+/* {{{ proto long date_timestamp_get(DateTimeAbstract object)
Gets the Unix timestamp.
*/
PHP_FUNCTION(date_timestamp_get)
@@ -3555,7 +3539,7 @@ PHP_FUNCTION(date_timestamp_get)
zend_long timestamp;
int error;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_abstract) == FAILURE) {
RETURN_FALSE;
}
dateobj = Z_PHPDATE_P(object);
@@ -3581,13 +3565,13 @@ PHP_FUNCTION(date_diff)
php_interval_obj *interval;
zend_long absolute = 0;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO|l", &object1, date_ce_abstract, &object2, date_ce_abstract, &absolute) == FAILURE) {
RETURN_FALSE;
}
dateobj1 = Z_PHPDATE_P(object1);
dateobj2 = Z_PHPDATE_P(object2);
- DATE_CHECK_INITIALIZED(dateobj1->time, DateTimeInterface);
- DATE_CHECK_INITIALIZED(dateobj2->time, DateTimeInterface);
+ DATE_CHECK_INITIALIZED(dateobj1->time, DateTimeAbstract);
+ DATE_CHECK_INITIALIZED(dateobj2->time, DateTimeAbstract);
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
@@ -3783,7 +3767,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
}
/* }}} */
-/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface datetime)
+/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeAbstract datetime)
Returns the timezone offset.
*/
PHP_FUNCTION(timezone_offset_get)
@@ -3793,13 +3777,13 @@ PHP_FUNCTION(timezone_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_abstract) == FAILURE) {
RETURN_FALSE;
}
tzobj = Z_PHPTIMEZONE_P(object);
DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone);
dateobj = Z_PHPDATE_P(dateobject);
- DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTimeAbstract);
switch (tzobj->type) {
case TIMELIB_ZONETYPE_ID:
@@ -4326,10 +4310,10 @@ PHP_METHOD(DatePeriod, __construct)
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, NULL, &error_handling);
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOl|l", &start, date_ce_interface, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOO|l", &start, date_ce_interface, &interval, date_ce_interval, &end, date_ce_interface, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOl|l", &start, date_ce_abstract, &interval, date_ce_interval, &recurrences, &options) == FAILURE) {
+ if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "OOO|l", &start, date_ce_abstract, &interval, date_ce_interval, &end, date_ce_abstract, &options) == FAILURE) {
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s|l", &isostr, &isostr_len, &options) == FAILURE) {
- php_error_docref(NULL, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments.");
+ php_error_docref(NULL, E_WARNING, "This constructor accepts either (DateTimeAbstract, DateInterval, int) OR (DateTimeAbstract, DateInterval, DateTime) OR (string) as arguments.");
zend_restore_error_handling(&error_handling);
return;
}
diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt
index ce2105a..6370d07 100644
--- a/ext/date/tests/68062.phpt
+++ b/ext/date/tests/68062.phpt
@@ -10,4 +10,4 @@ echo $tz->getOffset($dt);
echo $tz->getOffset(1);
--EXPECTF--
3600
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, integer given in %s
diff --git a/ext/date/tests/DatePeriod_wrong_constructor.phpt b/ext/date/tests/DatePeriod_wrong_constructor.phpt
index 8acdc5d..b53fcc5 100644
--- a/ext/date/tests/DatePeriod_wrong_constructor.phpt
+++ b/ext/date/tests/DatePeriod_wrong_constructor.phpt
@@ -10,7 +10,7 @@ date.timezone=UTC
new DatePeriod();
?>
--EXPECTF--
-Fatal error: Uncaught Exception: DatePeriod::__construct(): This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments. in %s:%d
+Fatal error: Uncaught Exception: DatePeriod::__construct(): This constructor accepts either (DateTimeAbstract, DateInterval, int) OR (DateTimeAbstract, DateInterval, DateTime) OR (string) as arguments. in %s:%d
Stack trace:
#0 %s(%d): DatePeriod->__construct()
#1 {main}
diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt
index 2ee21a5..31662d4 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 DateTimeInterface, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 1 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 12345 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int -12345 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- float 10.5 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float -10.5 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float .5 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- empty array --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- int indexed array --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- associative array --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- nested arrays --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- uppercase NULL --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase null --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase true --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- lowercase false --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- empty string DQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- empty string SQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string DQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string SQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- mixed case string --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- heredoc --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- instance of classWithToString --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- undefined var --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- unset var --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- resource --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeAbstract, resource given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/date_format_error.phpt b/ext/date/tests/date_format_error.phpt
index a563d0d..6a25f41 100644
--- a/ext/date/tests/date_format_error.phpt
+++ b/ext/date/tests/date_format_error.phpt
@@ -56,12 +56,12 @@ bool(false)
-- Testing date_create() function with an invalid values for $object argument --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, object given in %sp on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, object given in %sp on line %d
bool(false)
-Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-Warning: date_format() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/date_format_variation1.phpt b/ext/date/tests/date_format_variation1.phpt
index af76a7e..0b13dec 100644
--- a/ext/date/tests/date_format_variation1.phpt
+++ b/ext/date/tests/date_format_variation1.phpt
@@ -2,10 +2,10 @@
Test date_format() function : usage variation - Passing unexpected values to first argument $object.
--FILE--
<?php
-/* Prototype : string date_format ( DateTimeInterface $object , string $format )
+/* Prototype : string date_format ( DateTimeAbstract $object , string $format )
* Description: Returns date formatted according to given format
* Source code: ext/date/php_date.c
- * Alias to functions: DateTimeInterface::format
+ * Alias to functions: DateTimeAbstract::format
*/
echo "*** Testing date_format() : usage variation - unexpected values to first argument \$object***\n";
@@ -112,141 +112,141 @@ fclose( $file_handle );
-- int 0 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 1 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 12345 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int -12345 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- float 10.5 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float -10.5 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float .5 --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- empty array --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- int indexed array --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- associative array --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- nested arrays --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- uppercase NULL --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase null --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase true --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- lowercase false --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- empty string DQ --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- empty string SQ --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string DQ --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string SQ --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- mixed case string --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- heredoc --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- instance of classWithToString --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- undefined var --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- unset var --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- resource --
-Warning: date_format() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
+Warning: date_format() expects parameter 1 to be DateTimeAbstract, resource given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/date_offset_get_error.phpt b/ext/date/tests/date_offset_get_error.phpt
index 8531845..3abc2ab 100644
--- a/ext/date/tests/date_offset_get_error.phpt
+++ b/ext/date/tests/date_offset_get_error.phpt
@@ -3,10 +3,10 @@ Test date_offset_get() function : error conditions
--FILE--
<?php
-/* Prototype : int date_offset_get ( DateTimeInterface $object )
+/* Prototype : int date_offset_get ( DateTimeAbstract $object )
* Description: Returns the daylight saving time offset
* Source code: ext/date/php_date.c
- * Alias to functions: DateTimeInterface::getOffset
+ * Alias to functions: DateTimeAbstract::getOffset
*/
//Set the default time zone
@@ -46,12 +46,12 @@ bool(false)
-- Testing date_offset_get() function with an invalid values for $object argument --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/date_offset_get_variation1.phpt b/ext/date/tests/date_offset_get_variation1.phpt
index a3d93b3..3af441d 100644
--- a/ext/date/tests/date_offset_get_variation1.phpt
+++ b/ext/date/tests/date_offset_get_variation1.phpt
@@ -2,10 +2,10 @@
Test date_offset_get() function : usage variation - Passing unexpected values to first argument $object.
--FILE--
<?php
-/* Prototype : int date_offset_get ( DateTimeInterface $object )
+/* Prototype : int date_offset_get ( DateTimeAbstract $object )
* Description: Returns the daylight saving time offset
* Source code: ext/date/php_date.c
- * Alias to functions: DateTimeInterface::getOffset
+ * Alias to functions: DateTimeAbstract::getOffset
*/
echo "*** Testing date_offset_get() : usage variation - unexpected values to first argument \$object***\n";
@@ -110,141 +110,141 @@ fclose( $file_handle );
-- int 0 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 1 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 12345 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int -12345 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- float 10.5 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float -10.5 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float .5 --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- empty array --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- int indexed array --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- associative array --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- nested arrays --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- uppercase NULL --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase null --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase true --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- lowercase false --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- empty string DQ --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- empty string SQ --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string DQ --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string SQ --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- mixed case string --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- heredoc --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- instance of classWithToString --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- undefined var --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- unset var --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- resource --
-Warning: date_offset_get() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
+Warning: date_offset_get() expects parameter 1 to be DateTimeAbstract, resource given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/date_timestamp_get.phpt b/ext/date/tests/date_timestamp_get.phpt
index ec0258b..4c03835 100644
--- a/ext/date/tests/date_timestamp_get.phpt
+++ b/ext/date/tests/date_timestamp_get.phpt
@@ -17,4 +17,4 @@ bool(true)
-Warning: date_timestamp_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_timestamp_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
diff --git a/ext/date/tests/date_timezone_get_error.phpt b/ext/date/tests/date_timezone_get_error.phpt
index 01963c8..7d567d6 100644
--- a/ext/date/tests/date_timezone_get_error.phpt
+++ b/ext/date/tests/date_timezone_get_error.phpt
@@ -2,10 +2,10 @@
Test date_timezone_get() function : error conditions
--FILE--
<?php
-/* Prototype : DateTimeZone date_timezone_get ( DateTimeInterface $object )
- * Description: Return time zone relative to given DateTimeInterface
+/* Prototype : DateTimeZone date_timezone_get ( DateTimeAbstract $object )
+ * Description: Return time zone relative to given DateTimeAbstract
* Source code: ext/date/php_date.c
- * Alias to functions: DateTimeInterface::getTimezone
+ * Alias to functions: DateTimeAbstract::getTimezone
*/
// Set timezone
@@ -45,12 +45,12 @@ bool(false)
-- Testing date_timezone_get() function with an invalid values for $object argument --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/date_timezone_get_variation1.phpt b/ext/date/tests/date_timezone_get_variation1.phpt
index 4bbd414..7971452 100644
--- a/ext/date/tests/date_timezone_get_variation1.phpt
+++ b/ext/date/tests/date_timezone_get_variation1.phpt
@@ -2,10 +2,10 @@
Test date_timezone_get() function : usage variation - Passing unexpected values to first argument $object.
--FILE--
<?php
-/* Prototype : DateTimeZone date_timezone_get ( DateTimeInterface $object )
- * Description: Return time zone relative to given DateTimeInterface
+/* Prototype : DateTimeZone date_timezone_get ( DateTimeAbstract $object )
+ * Description: Return time zone relative to given DateTimeAbstract
* Source code: ext/date/php_date.c
- * Alias to functions: DateTimeInterface::getTimezone
+ * Alias to functions: DateTimeAbstract::getTimezone
*/
echo "*** Testing date_timezone_get() : usage variation - unexpected values to first argument \$object***\n";
@@ -110,141 +110,141 @@ fclose( $file_handle );
-- int 0 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 1 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int 12345 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- int -12345 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, integer given in %s on line %d
bool(false)
-- float 10.5 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float -10.5 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- float .5 --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, float given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, float given in %s on line %d
bool(false)
-- empty array --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- int indexed array --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- associative array --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- nested arrays --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, array given in %s on line %d
bool(false)
-- uppercase NULL --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase null --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- lowercase true --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- lowercase false --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, boolean given in %s on line %d
bool(false)
-- empty string DQ --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- empty string SQ --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string DQ --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- string SQ --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- mixed case string --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- heredoc --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, string given in %s on line %d
bool(false)
-- instance of classWithToString --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, object given in %s on line %d
bool(false)
-- undefined var --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- unset var --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, null given in %s on line %d
bool(false)
-- resource --
-Warning: date_timezone_get() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
+Warning: date_timezone_get() expects parameter 1 to be DateTimeAbstract, 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 7ce1ade..b3b01ec 100644
--- a/ext/date/tests/timezone_offset_get_error.phpt
+++ b/ext/date/tests/timezone_offset_get_error.phpt
@@ -116,10 +116,10 @@ string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of Da
-- Testing timezone_offset_get() function with an invalid values for $datetime argument --
-string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of stdClass given"
+string(%d) "Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, instance of stdClass given"
-string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given"
+string(%d) "Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, integer given"
-string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given"
+string(%d) "Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, null given"
===DONE===
diff --git a/ext/date/tests/timezone_offset_get_variation2.phpt b/ext/date/tests/timezone_offset_get_variation2.phpt
index 2d007d5..588822b 100644
--- a/ext/date/tests/timezone_offset_get_variation2.phpt
+++ b/ext/date/tests/timezone_offset_get_variation2.phpt
@@ -123,86 +123,86 @@ fclose( $file_handle );
*** Testing timezone_offset_get() : usage variation - unexpected values to second argument $datetime***
-- int 0 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, integer given
-- int 1 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, integer given
-- int 12345 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, integer given
-- int -12345 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, integer given
-- float 10.5 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, float given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, float given
-- float -10.5 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, float given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, float given
-- float .5 --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, float given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, float given
-- empty array --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, array given
-- int indexed array --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, array given
-- associative array --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, array given
-- nested arrays --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, array given
-- uppercase NULL --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, null given
-- lowercase null --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, null given
-- lowercase true --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, boolean given
-- lowercase false --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, boolean given
-- uppercase TRUE --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, boolean given
-- uppercase FALSE --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, boolean given
-- empty string DQ --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, string given
-- empty string SQ --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, string given
-- string DQ --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, string given
-- string SQ --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, string given
-- mixed case string --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, string given
-- heredoc --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, string given
-- instance of classWithToString --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of classWithToString given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, instance of classWithToString given
-- instance of classWithoutToString --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of classWithoutToString given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, instance of classWithoutToString given
-- undefined var --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, null given
-- unset var --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, null given
-- resource --
-Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, resource given
+Argument 2 passed to timezone_offset_get() must be an instance of DateTimeAbstract, resource given
===DONE===
@krakjoe
Copy link
Author

krakjoe commented Jul 21, 2015

<?php

class MyDateTime extends \DateTimeAbstract
{

    public function diff($datetime2, $absolute = false)
    {
    // TODO: Implement diff() method.
    }


    public function format($format)
    {
    // TODO: Implement format() method.
    }


    public function getOffset()
    {
    // TODO: Implement getOffset() method.
    }


    public function getTimestamp()
    {
    // TODO: Implement getTimestamp() method.
    }

    public function getTimezone()
    {
    // TODO: Implement getTimezone() method.
    }

    public function __wakeup()
    {
    // TODO: Implement __wakeup() method.
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment