mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/intl: Call DateTimeInterface::getTimestamp() directly (#17487)
This commit is contained in:
parent
b8ee4c2b19
commit
a100450cd9
4 changed files with 24 additions and 28 deletions
|
@ -64,8 +64,8 @@ static bool valid_format(zval *z) {
|
|||
|
||||
U_CFUNC PHP_FUNCTION(datefmt_format_object)
|
||||
{
|
||||
zval *object,
|
||||
*format = NULL;
|
||||
zend_object *object;
|
||||
zval *format = NULL;
|
||||
char *locale_str = NULL;
|
||||
size_t locale_len;
|
||||
bool pattern = false;
|
||||
|
@ -78,7 +78,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
|
|||
timeStyle = DateFormat::kDefault;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 3)
|
||||
Z_PARAM_OBJECT(object)
|
||||
Z_PARAM_OBJ(object)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_ZVAL(format)
|
||||
Z_PARAM_STRING_OR_NULL(locale_str, locale_len)
|
||||
|
@ -149,9 +149,9 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
|
|||
timeStyle = (DateFormat::EStyle)(timeStyle & ~DateFormat::kRelative);
|
||||
}
|
||||
|
||||
zend_class_entry *instance_ce = Z_OBJCE_P(object);
|
||||
zend_class_entry *instance_ce = object->ce;
|
||||
if (instanceof_function(instance_ce, Calendar_ce_ptr)) {
|
||||
Calendar *obj_cal = calendar_fetch_native_calendar(Z_OBJ_P(object));
|
||||
Calendar *obj_cal = calendar_fetch_native_calendar(object);
|
||||
if (obj_cal == NULL) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"datefmt_format_object: bad IntlCalendar instance: "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue