diff options
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 685 |
1 files changed, 342 insertions, 343 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 8f2e8c8fc5..f995f0e8df 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -539,8 +539,8 @@ const zend_function_entry date_funcs_period[] = { PHP_FE_END }; -static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC); -static void date_register_classes(TSRMLS_D); +static char* guess_timezone(const timelib_tzdb *tzdb); +static void date_register_classes(void); /* }}} */ ZEND_DECLARE_MODULE_GLOBALS(date) @@ -608,7 +608,7 @@ static zend_object_handlers date_object_handlers_period; return; \ } \ } else { \ - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, NULL, "O", &object, date_ce_date) == FAILURE) { \ + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), NULL, "O", &object, date_ce_date) == FAILURE) { \ RETURN_FALSE; \ } \ } \ @@ -616,39 +616,39 @@ static zend_object_handlers date_object_handlers_period; #define DATE_CHECK_INITIALIZED(member, class_name) \ if (!(member)) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \ + php_error_docref(NULL, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \ RETURN_FALSE; \ } -static void date_object_free_storage_date(zend_object *object TSRMLS_DC); -static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC); -static void date_object_free_storage_interval(zend_object *object TSRMLS_DC); -static void date_object_free_storage_period(zend_object *object TSRMLS_DC); - -static zend_object *date_object_new_date(zend_class_entry *class_type TSRMLS_DC); -static zend_object *date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); -static zend_object *date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); -static zend_object *date_object_new_period(zend_class_entry *class_type TSRMLS_DC); - -static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC); -static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC); -static zend_object *date_object_clone_interval(zval *this_ptr TSRMLS_DC); -static zend_object *date_object_clone_period(zval *this_ptr TSRMLS_DC); - -static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC); -static HashTable *date_object_get_gc(zval *object, zval **table, int *n TSRMLS_DC); -static HashTable *date_object_get_properties(zval *object TSRMLS_DC); -static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n TSRMLS_DC); -static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC); -static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n TSRMLS_DC); -static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC); -static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC); -static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n TSRMLS_DC); - -zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC); -void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC); -static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC); -static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC); +static void date_object_free_storage_date(zend_object *object); +static void date_object_free_storage_timezone(zend_object *object); +static void date_object_free_storage_interval(zend_object *object); +static void date_object_free_storage_period(zend_object *object); + +static zend_object *date_object_new_date(zend_class_entry *class_type); +static zend_object *date_object_new_timezone(zend_class_entry *class_type); +static zend_object *date_object_new_interval(zend_class_entry *class_type); +static zend_object *date_object_new_period(zend_class_entry *class_type); + +static zend_object *date_object_clone_date(zval *this_ptr); +static zend_object *date_object_clone_timezone(zval *this_ptr); +static zend_object *date_object_clone_interval(zval *this_ptr); +static zend_object *date_object_clone_period(zval *this_ptr); + +static int date_object_compare_date(zval *d1, zval *d2); +static HashTable *date_object_get_gc(zval *object, zval **table, int *n); +static HashTable *date_object_get_properties(zval *object); +static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n); +static HashTable *date_object_get_properties_interval(zval *object); +static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n); +static HashTable *date_object_get_properties_period(zval *object); +static HashTable *date_object_get_properties_timezone(zval *object); +static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n); + +zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv); +void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot); +static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv); +static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot); /* {{{ Module struct */ zend_module_entry date_module_entry = { @@ -832,7 +832,7 @@ PHP_RSHUTDOWN_FUNCTION(date) PHP_MINIT_FUNCTION(date) { REGISTER_INI_ENTRIES(); - date_register_classes(TSRMLS_C); + date_register_classes(); /* * RFC4287, Section 3.3: http://www.ietf.org/rfc/rfc4287.txt * A Date construct is an element whose content MUST conform to the @@ -896,7 +896,7 @@ PHP_MINFO_FUNCTION(date) php_info_print_table_row(2, "date/time support", "enabled"); php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version); php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal"); - php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb TSRMLS_CC)); + php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb)); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -904,7 +904,7 @@ PHP_MINFO_FUNCTION(date) /* }}} */ /* {{{ Timezone Cache functions */ -static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb TSRMLS_DC) +static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_tzdb *tzdb) { timelib_tzinfo *tzi; @@ -926,8 +926,7 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib_tzdb *tzdb) { - TSRMLS_FETCH(); - return php_date_parse_tzfile(formal_tzname, tzdb TSRMLS_CC); + return php_date_parse_tzfile(formal_tzname, tzdb); } /* }}} */ @@ -935,14 +934,14 @@ timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib /* {{{ static PHP_INI_MH(OnUpdate_date_timezone) */ static PHP_INI_MH(OnUpdate_date_timezone) { - if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) { + if (OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage) == FAILURE) { return FAILURE; } DATEG(timezone_valid) = 0; if (stage == PHP_INI_STAGE_RUNTIME) { if (!timelib_timezone_id_is_valid(DATEG(default_timezone), DATE_TIMEZONEDB)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG); + php_error_docref(NULL, E_WARNING, DATE_TZ_ERRMSG); } else { DATEG(timezone_valid) = 1; } @@ -953,7 +952,7 @@ static PHP_INI_MH(OnUpdate_date_timezone) /* }}} */ /* {{{ Helper functions */ -static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC) +static char* guess_timezone(const timelib_tzdb *tzdb) { /* Checking configure timezone */ if (DATEG(timezone) && (strlen(DATEG(timezone))) > 0) { @@ -974,7 +973,7 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC) } if (!timelib_timezone_id_is_valid(DATEG(default_timezone), tzdb)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone)); + php_error_docref(NULL, E_WARNING, "Invalid date.timezone value '%s', we selected the timezone 'UTC' for now.", DATEG(default_timezone)); return "UTC"; } @@ -982,19 +981,19 @@ static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC) return DATEG(default_timezone); } /* Fallback to UTC */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone."); + php_error_docref(NULL, E_WARNING, DATE_TZ_ERRMSG "We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone."); return "UTC"; } -PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D) +PHPAPI timelib_tzinfo *get_timezone_info(void) { char *tz; timelib_tzinfo *tzi; - tz = guess_timezone(DATE_TIMEZONEDB TSRMLS_CC); - tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB TSRMLS_CC); + tz = guess_timezone(DATE_TIMEZONEDB); + tzi = php_date_parse_tzfile(tz, DATE_TIMEZONEDB); if (! tzi) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Timezone database is corrupt - this should *never* happen!"); + php_error_docref(NULL, E_ERROR, "Timezone database is corrupt - this should *never* happen!"); } return tzi; } @@ -1058,7 +1057,7 @@ char *php_date_short_day_name(timelib_sll y, timelib_sll m, timelib_sll d) /* }}} */ /* {{{ date_format - (gm)date helper */ -static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime TSRMLS_DC) +static zend_string *date_format(char *format, size_t format_len, timelib_time *t, int localtime) { smart_str string = {0}; int i, length = 0; @@ -1222,18 +1221,18 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) size_t format_len; zend_long ts; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &ts) == FAILURE) { RETURN_FALSE; } if (ZEND_NUM_ARGS() == 1) { ts = time(NULL); } - RETURN_STR(php_format_date(format, format_len, ts, localtime TSRMLS_CC)); + RETURN_STR(php_format_date(format, format_len, ts, localtime)); } /* }}} */ -PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */ +PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime) /* {{{ */ { timelib_time *t; timelib_tzinfo *tzi; @@ -1242,7 +1241,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, t = timelib_time_ctor(); if (localtime) { - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(t, ts); @@ -1251,7 +1250,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, timelib_unixtime2gmt(t, ts); } - string = date_format(format, format_len, t, localtime TSRMLS_CC); + string = date_format(format, format_len, t, localtime); timelib_time_dtor(t); return string; @@ -1260,7 +1259,7 @@ PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, /* {{{ php_idate */ -PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC) +PHPAPI int php_idate(char format, time_t ts, int localtime) { timelib_time *t; timelib_tzinfo *tzi; @@ -1271,7 +1270,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC) t = timelib_time_ctor(); if (!localtime) { - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(t, ts); @@ -1379,12 +1378,12 @@ PHP_FUNCTION(idate) zend_long ts = 0; int ret; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, &ts) == FAILURE) { RETURN_FALSE; } if (format_len != 1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "idate format is one char"); + php_error_docref(NULL, E_WARNING, "idate format is one char"); RETURN_FALSE; } @@ -1392,9 +1391,9 @@ PHP_FUNCTION(idate) ts = time(NULL); } - ret = php_idate(format[0], ts, 0 TSRMLS_CC); + ret = php_idate(format[0], ts, 0); if (ret == -1) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token."); + php_error_docref(NULL, E_WARNING, "Unrecognized date format token."); RETURN_FALSE; } RETURN_LONG(ret); @@ -1451,9 +1450,9 @@ PHP_FUNCTION(strtotime) timelib_time *t, *now; timelib_tzinfo *tzi; - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "sl", ×, &time_len, &preset_ts) != FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sl", ×, &time_len, &preset_ts) != FAILURE) { /* We have an initial timestamp */ now = timelib_time_ctor(); @@ -1466,7 +1465,7 @@ PHP_FUNCTION(strtotime) timelib_unixtime2local(now, t->sse); timelib_time_dtor(t); efree(initial_ts); - } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", ×, &time_len, &preset_ts) != FAILURE) { + } else if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", ×, &time_len, &preset_ts) != FAILURE) { /* We have no initial timestamp */ now = timelib_time_ctor(); now->tz_info = tzi; @@ -1508,7 +1507,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) zend_long ts, adjust_seconds = 0; int error; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lllllll", &hou, &min, &sec, &mon, &day, &yea, &dst) == FAILURE) { RETURN_FALSE; } /* Initialize structure with current time */ @@ -1516,7 +1515,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) if (gmt) { timelib_unixtime2gmt(now, (timelib_sll) time(NULL)); } else { - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); now->tz_info = tzi; now->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(now, (timelib_sll) time(NULL)); @@ -1549,7 +1548,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) now->h = hou; break; default: - php_error_docref(NULL TSRMLS_CC, E_STRICT, "You should be using the time() function instead"); + php_error_docref(NULL, E_STRICT, "You should be using the time() function instead"); } /* Update the timestamp */ if (gmt) { @@ -1559,7 +1558,7 @@ PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt) } /* Support for the deprecated is_dst parameter */ if (dst != -1) { - php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The is_dst parameter is deprecated"); + php_error_docref(NULL, E_DEPRECATED, "The is_dst parameter is deprecated"); if (gmt) { /* GMT never uses DST */ if (dst == 1) { @@ -1613,7 +1612,7 @@ PHP_FUNCTION(checkdate) { zend_long m, d, y; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &m, &d, &y) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &m, &d, &y) == FAILURE) { RETURN_FALSE; } @@ -1641,7 +1640,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt) timestamp = (zend_long) time(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, ×tamp) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &format, &format_len, ×tamp) == FAILURE) { RETURN_FALSE; } @@ -1654,7 +1653,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt) tzi = NULL; timelib_unixtime2gmt(ts, (timelib_sll) timestamp); } else { - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); ts->tz_info = tzi; ts->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(ts, (timelib_sll) timestamp); @@ -1754,11 +1753,11 @@ PHP_FUNCTION(localtime) timelib_tzinfo *tzi; timelib_time *ts; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|lb", ×tamp, &associative) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|lb", ×tamp, &associative) == FAILURE) { RETURN_FALSE; } - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); ts = timelib_time_ctor(); ts->tz_info = tzi; ts->zone_type = TIMELIB_ZONETYPE_ID; @@ -1800,11 +1799,11 @@ PHP_FUNCTION(getdate) timelib_tzinfo *tzi; timelib_time *ts; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", ×tamp) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", ×tamp) == FAILURE) { RETURN_FALSE; } - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); ts = timelib_time_ctor(); ts->tz_info = tzi; ts->zone_type = TIMELIB_ZONETYPE_ID; @@ -1855,7 +1854,7 @@ typedef struct { } date_period_it; /* {{{ date_period_it_invalidate_current */ -static void date_period_it_invalidate_current(zend_object_iterator *iter TSRMLS_DC) +static void date_period_it_invalidate_current(zend_object_iterator *iter) { date_period_it *iterator = (date_period_it *)iter; @@ -1867,18 +1866,18 @@ static void date_period_it_invalidate_current(zend_object_iterator *iter TSRMLS_ /* }}} */ /* {{{ date_period_it_dtor */ -static void date_period_it_dtor(zend_object_iterator *iter TSRMLS_DC) +static void date_period_it_dtor(zend_object_iterator *iter) { date_period_it *iterator = (date_period_it *)iter; - date_period_it_invalidate_current(iter TSRMLS_CC); + date_period_it_invalidate_current(iter); zval_ptr_dtor(&iterator->intern.data); } /* }}} */ /* {{{ date_period_it_has_more */ -static int date_period_it_has_more(zend_object_iterator *iter TSRMLS_DC) +static int date_period_it_has_more(zend_object_iterator *iter) { date_period_it *iterator = (date_period_it *)iter; php_period_obj *object = Z_PHPPERIOD_P(&iterator->intern.data); @@ -1902,7 +1901,7 @@ static int date_period_it_has_more(zend_object_iterator *iter TSRMLS_DC) /* }}} */ /* {{{ date_period_it_current_data */ -static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC) +static zval *date_period_it_current_data(zend_object_iterator *iter) { date_period_it *iterator = (date_period_it *)iter; php_period_obj *object = Z_PHPPERIOD_P(&iterator->intern.data); @@ -1910,7 +1909,7 @@ static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC) php_date_obj *newdateobj; /* Create new object */ - php_date_instantiate(object->start_ce, &iterator->current TSRMLS_CC); + php_date_instantiate(object->start_ce, &iterator->current); newdateobj = Z_PHPDATE_P(&iterator->current); newdateobj->time = timelib_time_ctor(); *newdateobj->time = *it_time; @@ -1926,7 +1925,7 @@ static zval *date_period_it_current_data(zend_object_iterator *iter TSRMLS_DC) /* }}} */ /* {{{ date_period_it_current_key */ -static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC) +static void date_period_it_current_key(zend_object_iterator *iter, zval *key) { date_period_it *iterator = (date_period_it *)iter; ZVAL_LONG(key, iterator->current_index); @@ -1934,17 +1933,17 @@ static void date_period_it_current_key(zend_object_iterator *iter, zval *key TSR /* }}} */ /* {{{ date_period_it_move_forward */ -static void date_period_it_move_forward(zend_object_iterator *iter TSRMLS_DC) +static void date_period_it_move_forward(zend_object_iterator *iter) { date_period_it *iterator = (date_period_it *)iter; iterator->current_index++; - date_period_it_invalidate_current(iter TSRMLS_CC); + date_period_it_invalidate_current(iter); } /* }}} */ /* {{{ date_period_it_rewind */ -static void date_period_it_rewind(zend_object_iterator *iter TSRMLS_DC) +static void date_period_it_rewind(zend_object_iterator *iter) { date_period_it *iterator = (date_period_it *)iter; @@ -1953,7 +1952,7 @@ static void date_period_it_rewind(zend_object_iterator *iter TSRMLS_DC) timelib_time_dtor(iterator->object->current); } iterator->object->current = timelib_time_clone(iterator->object->start); - date_period_it_invalidate_current(iter TSRMLS_CC); + date_period_it_invalidate_current(iter); } /* }}} */ @@ -1968,7 +1967,7 @@ zend_object_iterator_funcs date_period_it_funcs = { date_period_it_invalidate_current }; -zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) /* {{{ */ +zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */ { date_period_it *iterator = emalloc(sizeof(date_period_it)); @@ -1976,7 +1975,7 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); } - zend_iterator_init((zend_object_iterator*)iterator TSRMLS_CC); + zend_iterator_init((zend_object_iterator*)iterator); ZVAL_COPY(&iterator->intern.data, object); iterator->intern.funcs = &date_period_it_funcs; @@ -1986,11 +1985,11 @@ 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 TSRMLS_DC) /* {{{ */ +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 TSRMLS_CC) && - !instanceof_function(implementor, date_ce_immutable TSRMLS_CC) + !instanceof_function(implementor, date_ce_date) && + !instanceof_function(implementor, date_ce_immutable) ) { zend_error(E_ERROR, "DateTimeInterface can't be implemented by user classes"); } @@ -1998,17 +1997,17 @@ static int implement_date_interface_handler(zend_class_entry *interface, zend_cl return SUCCESS; } /* }}} */ -static void date_register_classes(TSRMLS_D) /* {{{ */ +static void date_register_classes(void) /* {{{ */ { zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface; INIT_CLASS_ENTRY(ce_interface, "DateTimeInterface", date_funcs_interface); - date_ce_interface = zend_register_internal_interface(&ce_interface TSRMLS_CC); + date_ce_interface = zend_register_internal_interface(&ce_interface); date_ce_interface->interface_gets_implemented = implement_date_interface_handler; 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 TSRMLS_CC); + date_ce_date = zend_register_internal_class_ex(&ce_date, NULL); 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; @@ -2016,10 +2015,10 @@ static void date_register_classes(TSRMLS_D) /* {{{ */ 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 TSRMLS_CC, 1, date_ce_interface); + 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 TSRMLS_CC); + zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1); REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339); REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE); @@ -2035,16 +2034,16 @@ static void date_register_classes(TSRMLS_D) /* {{{ */ 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 TSRMLS_CC); + date_ce_immutable = zend_register_internal_class_ex(&ce_immutable, NULL); 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 TSRMLS_CC, 1, date_ce_interface); + 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; - date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL TSRMLS_CC); + date_ce_timezone = zend_register_internal_class_ex(&ce_timezone, NULL); memcpy(&date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); date_object_handlers_timezone.offset = XtOffsetOf(php_timezone_obj, std); date_object_handlers_timezone.free_obj = date_object_free_storage_timezone; @@ -2053,7 +2052,7 @@ static void date_register_classes(TSRMLS_D) /* {{{ */ date_object_handlers_timezone.get_gc = date_object_get_gc_timezone; #define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \ - zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value TSRMLS_CC); + zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value); REGISTER_TIMEZONE_CLASS_CONST_STRING("AFRICA", PHP_DATE_TIMEZONE_GROUP_AFRICA); REGISTER_TIMEZONE_CLASS_CONST_STRING("AMERICA", PHP_DATE_TIMEZONE_GROUP_AMERICA); @@ -2072,7 +2071,7 @@ static void date_register_classes(TSRMLS_D) /* {{{ */ INIT_CLASS_ENTRY(ce_interval, "DateInterval", date_funcs_interval); ce_interval.create_object = date_object_new_interval; - date_ce_interval = zend_register_internal_class_ex(&ce_interval, NULL TSRMLS_CC); + date_ce_interval = zend_register_internal_class_ex(&ce_interval, NULL); memcpy(&date_object_handlers_interval, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); date_object_handlers_interval.offset = XtOffsetOf(php_interval_obj, std); date_object_handlers_interval.free_obj = date_object_free_storage_interval; @@ -2085,10 +2084,10 @@ static void date_register_classes(TSRMLS_D) /* {{{ */ INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period); ce_period.create_object = date_object_new_period; - date_ce_period = zend_register_internal_class_ex(&ce_period, NULL TSRMLS_CC); + date_ce_period = zend_register_internal_class_ex(&ce_period, NULL); date_ce_period->get_iterator = date_object_period_get_iterator; date_ce_period->iterator_funcs.funcs = &date_period_it_funcs; - zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable); + zend_class_implements(date_ce_period, 1, zend_ce_traversable); memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); date_object_handlers_period.offset = XtOffsetOf(php_period_obj, std); date_object_handlers_period.free_obj = date_object_free_storage_period; @@ -2100,18 +2099,18 @@ static void date_register_classes(TSRMLS_D) /* {{{ */ date_object_handlers_period.write_property = date_period_write_property; #define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \ - zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC); + zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value); REGISTER_PERIOD_CLASS_CONST_STRING("EXCLUDE_START_DATE", PHP_DATE_PERIOD_EXCLUDE_START_DATE); } /* }}} */ -static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */ +static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, int init_props) /* {{{ */ { php_date_obj *intern; intern = ecalloc(1, sizeof(php_date_obj) + sizeof(zval) * (class_type->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); if (init_props) { object_properties_init(&intern->std, class_type); } @@ -2120,17 +2119,17 @@ static inline zend_object *date_object_new_date_ex(zend_class_entry *class_type, return &intern->std; } /* }}} */ -static zend_object *date_object_new_date(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *date_object_new_date(zend_class_entry *class_type) /* {{{ */ { - return date_object_new_date_ex(class_type, 1 TSRMLS_CC); + return date_object_new_date_ex(class_type, 1); } /* }}} */ -static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */ +static zend_object *date_object_clone_date(zval *this_ptr) /* {{{ */ { php_date_obj *old_obj = Z_PHPDATE_P(this_ptr); - php_date_obj *new_obj = php_date_obj_from_obj(date_object_new_date_ex(old_obj->std.ce, 0 TSRMLS_CC)); + php_date_obj *new_obj = php_date_obj_from_obj(date_object_new_date_ex(old_obj->std.ce, 0)); - zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC); + zend_objects_clone_members(&new_obj->std, &old_obj->std); if (!old_obj->time) { return &new_obj->std; } @@ -2148,18 +2147,18 @@ static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */ return &new_obj->std; } /* }}} */ -static void date_clone_immutable(zval *object, zval *new_object TSRMLS_DC) /* {{{ */ +static void date_clone_immutable(zval *object, zval *new_object) /* {{{ */ { - ZVAL_OBJ(new_object, date_object_clone_date(object TSRMLS_CC)); + ZVAL_OBJ(new_object, date_object_clone_date(object)); } /* }}} */ -static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */ +static int date_object_compare_date(zval *d1, zval *d2) /* {{{ */ { php_date_obj *o1 = Z_PHPDATE_P(d1); php_date_obj *o2 = Z_PHPDATE_P(d2); if (!o1->time || !o2->time) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object"); + php_error_docref(NULL, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object"); return 1; } if (!o1->time->sse_uptodate) { @@ -2172,21 +2171,21 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */ return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1); } /* }}} */ -static HashTable *date_object_get_gc(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_gc(zval *object, zval **table, int *n) /* {{{ */ { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(object); } /* }}} */ -static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n) /* {{{ */ { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(object); } /* }}} */ -static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_properties(zval *object) /* {{{ */ { HashTable *props; zval zv; @@ -2195,14 +2194,14 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */ dateobj = Z_PHPDATE_P(object); - props = zend_std_get_properties(object TSRMLS_CC); + props = zend_std_get_properties(object); if (!dateobj->time || GC_G(gc_active)) { return props; } /* first we add the date and time in ISO format */ - ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1 TSRMLS_CC)); + ZVAL_STR(&zv, date_format("Y-m-d H:i:s.u", sizeof("Y-m-d H:i:s.u")-1, dateobj->time, 1)); zend_hash_str_update(props, "date", sizeof("date")-1, &zv); /* then we add the timezone name (or similar) */ @@ -2236,13 +2235,13 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC) /* {{{ */ return props; } /* }}} */ -static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */ +static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_type, int init_props) /* {{{ */ { php_timezone_obj *intern; intern = ecalloc(1, sizeof(php_timezone_obj) + sizeof(zval) * (class_type->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); if (init_props) { object_properties_init(&intern->std, class_type); } @@ -2251,17 +2250,17 @@ static inline zend_object *date_object_new_timezone_ex(zend_class_entry *class_t return &intern->std; } /* }}} */ -static zend_object *date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *date_object_new_timezone(zend_class_entry *class_type) /* {{{ */ { - return date_object_new_timezone_ex(class_type, 1 TSRMLS_CC); + return date_object_new_timezone_ex(class_type, 1); } /* }}} */ -static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC) /* {{{ */ +static zend_object *date_object_clone_timezone(zval *this_ptr) /* {{{ */ { php_timezone_obj *old_obj = Z_PHPTIMEZONE_P(this_ptr); - php_timezone_obj *new_obj = php_timezone_obj_from_obj(date_object_new_timezone_ex(old_obj->std.ce, 0 TSRMLS_CC)); + php_timezone_obj *new_obj = php_timezone_obj_from_obj(date_object_new_timezone_ex(old_obj->std.ce, 0)); - zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC); + zend_objects_clone_members(&new_obj->std, &old_obj->std); if (!old_obj->initialized) { return &new_obj->std; } @@ -2285,7 +2284,7 @@ static zend_object *date_object_clone_timezone(zval *this_ptr TSRMLS_DC) /* {{{ return &new_obj->std; } /* }}} */ -static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */ { HashTable *props; zval zv; @@ -2294,7 +2293,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /* tzobj = Z_PHPTIMEZONE_P(object); - props = zend_std_get_properties(object TSRMLS_CC); + props = zend_std_get_properties(object); if (!tzobj->initialized) { return props; @@ -2327,13 +2326,13 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) /* return props; } /* }}} */ -static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */ +static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_type, int init_props) /* {{{ */ { php_interval_obj *intern; intern = ecalloc(1, sizeof(php_interval_obj) + sizeof(zval) * (class_type->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); if (init_props) { object_properties_init(&intern->std, class_type); } @@ -2342,31 +2341,31 @@ static inline zend_object *date_object_new_interval_ex(zend_class_entry *class_t return &intern->std; } /* }}} */ -static zend_object *date_object_new_interval(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *date_object_new_interval(zend_class_entry *class_type) /* {{{ */ { - return date_object_new_interval_ex(class_type, 1 TSRMLS_CC); + return date_object_new_interval_ex(class_type, 1); } /* }}} */ -static zend_object *date_object_clone_interval(zval *this_ptr TSRMLS_DC) /* {{{ */ +static zend_object *date_object_clone_interval(zval *this_ptr) /* {{{ */ { php_interval_obj *old_obj = Z_PHPINTERVAL_P(this_ptr); - php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0 TSRMLS_CC)); + php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0)); - zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC); + zend_objects_clone_members(&new_obj->std, &old_obj->std); /** FIX ME ADD CLONE STUFF **/ return &new_obj->std; } /* }}} */ -static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_gc_interval(zval *object, zval **table, int *n) /* {{{ */ { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(object); } /* }}} */ -static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_properties_interval(zval *object) /* {{{ */ { HashTable *props; zval zv; @@ -2374,7 +2373,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /* intervalobj = Z_PHPINTERVAL_P(object); - props = zend_std_get_properties(object TSRMLS_CC); + props = zend_std_get_properties(object); if (!intervalobj->initialized) { return props; @@ -2408,13 +2407,13 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC) /* return props; } /* }}} */ -static inline zend_object *date_object_new_period_ex(zend_class_entry *class_type, int init_props TSRMLS_DC) /* {{{ */ +static inline zend_object *date_object_new_period_ex(zend_class_entry *class_type, int init_props) /* {{{ */ { php_period_obj *intern; intern = ecalloc(1, sizeof(php_period_obj) + sizeof(zval) * (class_type->default_properties_count - 1)); - zend_object_std_init(&intern->std, class_type TSRMLS_CC); + zend_object_std_init(&intern->std, class_type); if (init_props) { object_properties_init(&intern->std, class_type); } @@ -2424,23 +2423,23 @@ static inline zend_object *date_object_new_period_ex(zend_class_entry *class_typ return &intern->std; } /* }}} */ -static zend_object *date_object_new_period(zend_class_entry *class_type TSRMLS_DC) /* {{{ */ +static zend_object *date_object_new_period(zend_class_entry *class_type) /* {{{ */ { - return date_object_new_period_ex(class_type, 1 TSRMLS_CC); + return date_object_new_period_ex(class_type, 1); } /* }}} */ -static zend_object *date_object_clone_period(zval *this_ptr TSRMLS_DC) /* {{{ */ +static zend_object *date_object_clone_period(zval *this_ptr) /* {{{ */ { php_period_obj *old_obj = Z_PHPPERIOD_P(this_ptr); - php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0 TSRMLS_CC)); + php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0)); - zend_objects_clone_members(&new_obj->std, &old_obj->std TSRMLS_CC); + zend_objects_clone_members(&new_obj->std, &old_obj->std); /** FIX ME ADD CLONE STUFF **/ return &new_obj->std; } /* }}} */ -static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{ */ +static void date_object_free_storage_date(zend_object *object) /* {{{ */ { php_date_obj *intern = php_date_obj_from_obj(object); @@ -2448,28 +2447,28 @@ static void date_object_free_storage_date(zend_object *object TSRMLS_DC) /* {{{ timelib_time_dtor(intern->time); } - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); } /* }}} */ -static void date_object_free_storage_timezone(zend_object *object TSRMLS_DC) /* {{{ */ +static void date_object_free_storage_timezone(zend_object *object) /* {{{ */ { php_timezone_obj *intern = php_timezone_obj_from_obj(object); if (intern->type == TIMELIB_ZONETYPE_ABBR) { free(intern->tzi.z.abbr); } - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); } /* }}} */ -static void date_object_free_storage_interval(zend_object *object TSRMLS_DC) /* {{{ */ +static void date_object_free_storage_interval(zend_object *object) /* {{{ */ { php_interval_obj *intern = php_interval_obj_from_obj(object); timelib_rel_time_dtor(intern->diff); - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); } /* }}} */ -static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{{ */ +static void date_object_free_storage_period(zend_object *object) /* {{{ */ { php_period_obj *intern = php_period_obj_from_obj(object); @@ -2486,11 +2485,11 @@ static void date_object_free_storage_period(zend_object *object TSRMLS_DC) /* {{ } timelib_rel_time_dtor(intern->interval); - zend_object_std_dtor(&intern->std TSRMLS_CC); + zend_object_std_dtor(&intern->std); } /* }}} */ /* Advanced Interface */ -PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) /* {{{ */ +PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object) /* {{{ */ { object_init_ex(object, pce); return object; @@ -2498,7 +2497,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) /* Helper function used to store the latest found warnings and errors while * parsing, from either strtotime or parse_from_format. */ -static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_DC) /* {{{ */ +static void update_errors_warnings(timelib_error_container *last_errors) /* {{{ */ { if (DATEG(last_errors)) { timelib_error_container_dtor(DATEG(last_errors)); @@ -2507,7 +2506,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D DATEG(last_errors) = last_errors; } /* }}} */ -PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC) /* {{{ */ +PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, size_t time_str_len, char *format, zval *timezone_object, int ctor) /* {{{ */ { timelib_time *now; timelib_tzinfo *tzi = NULL; @@ -2526,12 +2525,12 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, } /* update last errors and warnings */ - update_errors_warnings(err TSRMLS_CC); + update_errors_warnings(err); if (ctor && err && err->error_count) { /* spit out the first library error message, at least */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str, + php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", time_str, err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message); } if (err && err->error_count) { @@ -2561,7 +2560,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, } else if (dateobj->time->tz_info) { tzi = dateobj->time->tz_info; } else { - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); } now = timelib_time_ctor(); @@ -2602,12 +2601,12 @@ PHP_FUNCTION(date_create) size_t time_str_len = 0; zval datetime_object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC); - if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) { + php_date_instantiate(date_ce_date, &datetime_object); + if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0)) { zval_dtor(&datetime_object); RETURN_FALSE; } @@ -2625,12 +2624,12 @@ PHP_FUNCTION(date_create_immutable) size_t time_str_len = 0; zval datetime_object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC); - if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0 TSRMLS_CC)) { + php_date_instantiate(date_ce_immutable, &datetime_object); + if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, NULL, timezone_object, 0)) { zval_dtor(&datetime_object); RETURN_FALSE; } @@ -2648,12 +2647,12 @@ PHP_FUNCTION(date_create_from_format) size_t time_str_len = 0, format_str_len = 0; zval datetime_object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_date, &datetime_object TSRMLS_CC); - if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) { + php_date_instantiate(date_ce_date, &datetime_object); + if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0)) { zval_dtor(&datetime_object); RETURN_FALSE; } @@ -2671,12 +2670,12 @@ PHP_FUNCTION(date_create_immutable_from_format) size_t time_str_len = 0, format_str_len = 0; zval datetime_object; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|O", &format_str, &format_str_len, &time_str, &time_str_len, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_immutable, &datetime_object TSRMLS_CC); - if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0 TSRMLS_CC)) { + php_date_instantiate(date_ce_immutable, &datetime_object); + if (!php_date_initialize(Z_PHPDATE_P(&datetime_object), time_str, time_str_len, format_str, timezone_object, 0)) { zval_dtor(&datetime_object); RETURN_FALSE; } @@ -2694,13 +2693,13 @@ PHP_METHOD(DateTime, __construct) size_t time_str_len = 0; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { - if (!php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) { + zend_replace_error_handling(EH_THROW, NULL, &error_handling); + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { + if (!php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1)) { ZEND_CTOR_MAKE_NULL(); } } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -2714,11 +2713,11 @@ PHP_METHOD(DateTimeImmutable, __construct) size_t time_str_len = 0; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { - php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC); + zend_replace_error_handling(EH_THROW, NULL, &error_handling); + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) { + php_date_initialize(Z_PHPDATE_P(getThis()), time_str, time_str_len, NULL, timezone_object, 1); } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -2731,11 +2730,11 @@ PHP_METHOD(DateTimeImmutable, createFromMutable) php_date_obj *new_obj = NULL; php_date_obj *old_obj = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "O!", &datetime_object, date_ce_date) == FAILURE) { return; } - php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC); + php_date_instantiate(date_ce_immutable, return_value); old_obj = Z_PHPDATE_P(datetime_object); new_obj = Z_PHPDATE_P(return_value); @@ -2750,7 +2749,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable) } /* }}} */ -static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht TSRMLS_DC) +static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht) { zval *z_date; zval *z_timezone; @@ -2775,7 +2774,7 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht char *tmp = emalloc(Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 2); int ret; snprintf(tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 2, "%s %s", Z_STRVAL_P(z_date), Z_STRVAL_P(z_timezone)); - ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC); + ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_P(z_date) + Z_STRLEN_P(z_timezone) + 1, NULL, NULL, 0); efree(tmp); return 1 == ret; } @@ -2784,18 +2783,18 @@ static int php_date_initialize_from_hash(php_date_obj **dateobj, HashTable *myht int ret; convert_to_string(z_timezone); - tzi = php_date_parse_tzfile(Z_STRVAL_P(z_timezone), DATE_TIMEZONEDB TSRMLS_CC); + tzi = php_date_parse_tzfile(Z_STRVAL_P(z_timezone), DATE_TIMEZONEDB); if (tzi == NULL) { return 0; } - tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj TSRMLS_CC)); + tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj)); tzobj->type = TIMELIB_ZONETYPE_ID; tzobj->tzi.tz = tzi; tzobj->initialized = 1; - ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0 TSRMLS_CC); + ret = php_date_initialize(*dateobj, Z_STRVAL_P(z_date), Z_STRLEN_P(z_date), NULL, &tmp_obj, 0); zval_ptr_dtor(&tmp_obj); return 1 == ret; } @@ -2814,15 +2813,15 @@ PHP_METHOD(DateTime, __set_state) zval *array; HashTable *myht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) { RETURN_FALSE; } myht = HASH_OF(array); - php_date_instantiate(date_ce_date, return_value TSRMLS_CC); + php_date_instantiate(date_ce_date, return_value); dateobj = Z_PHPDATE_P(return_value); - if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) { + if (!php_date_initialize_from_hash(&dateobj, myht)) { php_error(E_ERROR, "Invalid serialization data for DateTime object"); } } @@ -2836,15 +2835,15 @@ PHP_METHOD(DateTimeImmutable, __set_state) zval *array; HashTable *myht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) { RETURN_FALSE; } myht = HASH_OF(array); - php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC); + php_date_instantiate(date_ce_immutable, return_value); dateobj = Z_PHPDATE_P(return_value); - if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) { + if (!php_date_initialize_from_hash(&dateobj, myht)) { php_error(E_ERROR, "Invalid serialization data for DateTimeImmutable object"); } } @@ -2862,7 +2861,7 @@ PHP_METHOD(DateTime, __wakeup) myht = Z_OBJPROP_P(object); - if (!php_date_initialize_from_hash(&dateobj, myht TSRMLS_CC)) { + if (!php_date_initialize_from_hash(&dateobj, myht)) { php_error(E_ERROR, "Invalid serialization data for DateTime object"); } } @@ -2987,7 +2986,7 @@ PHP_FUNCTION(date_parse) struct timelib_error_container *error; timelib_time *parsed_time; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &date, &date_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &date, &date_len) == FAILURE) { RETURN_FALSE; } @@ -3006,7 +3005,7 @@ PHP_FUNCTION(date_parse_from_format) struct timelib_error_container *error; timelib_time *parsed_time; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &format, &format_len, &date, &date_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &format, &format_len, &date, &date_len) == FAILURE) { RETURN_FALSE; } @@ -3025,16 +3024,16 @@ PHP_FUNCTION(date_format) char *format; size_t format_len; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interface, &format, &format_len) == FAILURE) { RETURN_FALSE; } dateobj = Z_PHPDATE_P(object); DATE_CHECK_INITIALIZED(dateobj->time, DateTime); - RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime TSRMLS_CC)); + RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime)); } /* }}} */ -static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */ +static int php_date_modify(zval *object, char *modify, size_t modify_len) /* {{{ */ { php_date_obj *dateobj; timelib_time *tmp_time; @@ -3043,17 +3042,17 @@ static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_ dateobj = Z_PHPDATE_P(object); if (!(dateobj->time)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The DateTime object has not been correctly initialized by its constructor"); + php_error_docref(NULL, E_WARNING, "The DateTime object has not been correctly initialized by its constructor"); return 0; } tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); /* update last errors and warnings */ - update_errors_warnings(err TSRMLS_CC); + update_errors_warnings(err); if (err && err->error_count) { /* spit out the first library error message, at least */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", modify, + php_error_docref(NULL, E_WARNING, "Failed to parse time string (%s) at position %d (%c): %s", modify, err->error_messages[0].position, err->error_messages[0].character, err->error_messages[0].message); timelib_time_dtor(tmp_time); return 0; @@ -3105,11 +3104,11 @@ PHP_FUNCTION(date_modify) char *modify; size_t modify_len; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_date, &modify, &modify_len) == FAILURE) { RETURN_FALSE; } - if (php_date_modify(object, modify, modify_len TSRMLS_CC)) { + if (php_date_modify(object, modify, modify_len)) { RETURN_ZVAL(object, 1, 0); } @@ -3125,12 +3124,12 @@ PHP_METHOD(DateTimeImmutable, modify) char *modify; size_t modify_len; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_immutable, &modify, &modify_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_immutable, &modify, &modify_len) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - if (php_date_modify(&new_object, modify, modify_len TSRMLS_CC)) { + date_clone_immutable(object, &new_object); + if (php_date_modify(&new_object, modify, modify_len)) { RETURN_ZVAL(&new_object, 0, 1); } @@ -3138,7 +3137,7 @@ PHP_METHOD(DateTimeImmutable, modify) } /* }}} */ -static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_add(zval *object, zval *interval, zval *return_value) /* {{{ */ { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3161,11 +3160,11 @@ PHP_FUNCTION(date_add) { zval *object, *interval; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; } - php_date_add(object, interval, return_value TSRMLS_CC); + php_date_add(object, interval, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3177,18 +3176,18 @@ PHP_METHOD(DateTimeImmutable, add) { zval *object, *interval, new_object; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_add(&new_object, interval, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_add(&new_object, interval, return_value); RETURN_ZVAL(&new_object, 0, 1); } /* }}} */ -static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_sub(zval *object, zval *interval, zval *return_value) /* {{{ */ { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3200,7 +3199,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval); if (intobj->diff->have_special_relative) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only non-special relative time specifications are supported for subtraction"); + php_error_docref(NULL, E_WARNING, "Only non-special relative time specifications are supported for subtraction"); return; } @@ -3216,11 +3215,11 @@ PHP_FUNCTION(date_sub) { zval *object, *interval; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; } - php_date_sub(object, interval, return_value TSRMLS_CC); + php_date_sub(object, interval, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3232,12 +3231,12 @@ PHP_METHOD(DateTimeImmutable, sub) { zval *object, *interval, new_object; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_sub(&new_object, interval, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_sub(&new_object, interval, return_value); RETURN_ZVAL(&new_object, 0, 1); } @@ -3272,13 +3271,13 @@ PHP_FUNCTION(date_timezone_get) php_date_obj *dateobj; php_timezone_obj *tzobj; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) { RETURN_FALSE; } dateobj = Z_PHPDATE_P(object); DATE_CHECK_INITIALIZED(dateobj->time, DateTime); if (dateobj->time->is_localtime/* && dateobj->time->tz_info*/) { - php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC); + php_date_instantiate(date_ce_timezone, return_value); tzobj = Z_PHPTIMEZONE_P(return_value); set_timezone_from_timelib_time(tzobj, dateobj->time); } else { @@ -3287,7 +3286,7 @@ PHP_FUNCTION(date_timezone_get) } /* }}} */ -static void php_date_timezone_set(zval *object, zval *timezone_object, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_timezone_set(zval *object, zval *timezone_object, zval *return_value) /* {{{ */ { php_date_obj *dateobj; php_timezone_obj *tzobj; @@ -3318,11 +3317,11 @@ PHP_FUNCTION(date_timezone_set) zval *object; zval *timezone_object; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - php_date_timezone_set(object, timezone_object, return_value TSRMLS_CC); + php_date_timezone_set(object, timezone_object, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3335,12 +3334,12 @@ PHP_METHOD(DateTimeImmutable, setTimezone) zval *object, new_object; zval *timezone_object; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_immutable, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_immutable, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_timezone_set(&new_object, timezone_object, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_timezone_set(&new_object, timezone_object, return_value); RETURN_ZVAL(&new_object, 0, 1); } @@ -3355,7 +3354,7 @@ PHP_FUNCTION(date_offset_get) php_date_obj *dateobj; timelib_time_offset *offset; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) { RETURN_FALSE; } dateobj = Z_PHPDATE_P(object); @@ -3381,7 +3380,7 @@ PHP_FUNCTION(date_offset_get) } /* }}} */ -static void php_date_time_set(zval *object, zend_long h, zend_long i, zend_long s, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_time_set(zval *object, zend_long h, zend_long i, zend_long s, zval *return_value) /* {{{ */ { php_date_obj *dateobj; @@ -3401,11 +3400,11 @@ PHP_FUNCTION(date_time_set) zval *object; zend_long h, i, s = 0; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_date, &h, &i, &s) == FAILURE) { RETURN_FALSE; } - php_date_time_set(object, h, i, s, return_value TSRMLS_CC); + php_date_time_set(object, h, i, s, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3418,18 +3417,18 @@ PHP_METHOD(DateTimeImmutable, setTime) zval *object, new_object; zend_long h, i, s = 0; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_immutable, &h, &i, &s) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_immutable, &h, &i, &s) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_time_set(&new_object, h, i, s, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_time_set(&new_object, h, i, s, return_value); RETURN_ZVAL(&new_object, 0, 1); } /* }}} */ -static void php_date_date_set(zval *object, zend_long y, zend_long m, zend_long d, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_date_set(zval *object, zend_long y, zend_long m, zend_long d, zval *return_value) /* {{{ */ { php_date_obj *dateobj; @@ -3449,11 +3448,11 @@ PHP_FUNCTION(date_date_set) zval *object; zend_long y, m, d; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olll", &object, date_ce_date, &y, &m, &d) == FAILURE) { RETURN_FALSE; } - php_date_date_set(object, y, m, d, return_value TSRMLS_CC); + php_date_date_set(object, y, m, d, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3466,18 +3465,18 @@ PHP_METHOD(DateTimeImmutable, setDate) zval *object, new_object; zend_long y, m, d; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olll", &object, date_ce_immutable, &y, &m, &d) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Olll", &object, date_ce_immutable, &y, &m, &d) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_date_set(&new_object, y, m, d, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_date_set(&new_object, y, m, d, return_value); RETURN_ZVAL(&new_object, 0, 1); } /* }}} */ -static void php_date_isodate_set(zval *object, zend_long y, zend_long w, zend_long d, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_isodate_set(zval *object, zend_long y, zend_long w, zend_long d, zval *return_value) /* {{{ */ { php_date_obj *dateobj; @@ -3501,11 +3500,11 @@ PHP_FUNCTION(date_isodate_set) zval *object; zend_long y, w, d = 1; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_date, &y, &w, &d) == FAILURE) { RETURN_FALSE; } - php_date_isodate_set(object, y, w, d, return_value TSRMLS_CC); + php_date_isodate_set(object, y, w, d, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3518,18 +3517,18 @@ PHP_METHOD(DateTimeImmutable, setISODate) zval *object, new_object; zend_long y, w, d = 1; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oll|l", &object, date_ce_immutable, &y, &w, &d) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oll|l", &object, date_ce_immutable, &y, &w, &d) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_isodate_set(&new_object, y, w, d, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_isodate_set(&new_object, y, w, d, return_value); RETURN_ZVAL(&new_object, 0, 1); } /* }}} */ -static void php_date_timestamp_set(zval *object, zend_long timestamp, zval *return_value TSRMLS_DC) /* {{{ */ +static void php_date_timestamp_set(zval *object, zend_long timestamp, zval *return_value) /* {{{ */ { php_date_obj *dateobj; @@ -3547,11 +3546,11 @@ PHP_FUNCTION(date_timestamp_set) zval *object; zend_long timestamp; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &object, date_ce_date, ×tamp) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, date_ce_date, ×tamp) == FAILURE) { RETURN_FALSE; } - php_date_timestamp_set(object, timestamp, return_value TSRMLS_CC); + php_date_timestamp_set(object, timestamp, return_value); RETURN_ZVAL(object, 1, 0); } @@ -3564,12 +3563,12 @@ PHP_METHOD(DateTimeImmutable, setTimestamp) zval *object, new_object; zend_long timestamp; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &object, date_ce_immutable, ×tamp) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &object, date_ce_immutable, ×tamp) == FAILURE) { RETURN_FALSE; } - date_clone_immutable(object, &new_object TSRMLS_CC); - php_date_timestamp_set(&new_object, timestamp, return_value TSRMLS_CC); + date_clone_immutable(object, &new_object); + php_date_timestamp_set(&new_object, timestamp, return_value); RETURN_ZVAL(&new_object, 0, 1); } @@ -3585,7 +3584,7 @@ PHP_FUNCTION(date_timestamp_get) zend_long timestamp; int error; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_interface) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_interface) == FAILURE) { RETURN_FALSE; } dateobj = Z_PHPDATE_P(object); @@ -3611,7 +3610,7 @@ PHP_FUNCTION(date_diff) php_interval_obj *interval; zend_long absolute = 0; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, 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_interface, &object2, date_ce_interface, &absolute) == FAILURE) { RETURN_FALSE; } dateobj1 = Z_PHPDATE_P(object1); @@ -3621,7 +3620,7 @@ PHP_FUNCTION(date_diff) timelib_update_ts(dateobj1->time, NULL); timelib_update_ts(dateobj2->time, NULL); - php_date_instantiate(date_ce_interval, return_value TSRMLS_CC); + php_date_instantiate(date_ce_interval, return_value); interval = Z_PHPINTERVAL_P(return_value); interval->diff = timelib_diff(dateobj1->time, dateobj2->time); if (absolute) { @@ -3631,7 +3630,7 @@ PHP_FUNCTION(date_diff) } /* }}} */ -static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRMLS_DC) /* {{{ */ +static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz) /* {{{ */ { timelib_time *dummy_t = ecalloc(1, sizeof(timelib_time)); int dst, not_found; @@ -3639,7 +3638,7 @@ static int timezone_initialize(php_timezone_obj *tzobj, /*const*/ char *tz TSRML dummy_t->z = timelib_parse_zone(&tz, &dst, dummy_t, ¬_found, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); if (not_found) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad timezone (%s)", orig_tz); + php_error_docref(NULL, E_WARNING, "Unknown or bad timezone (%s)", orig_tz); efree(dummy_t); return FAILURE; } else { @@ -3659,11 +3658,11 @@ PHP_FUNCTION(timezone_open) size_t tz_len; php_timezone_obj *tzobj; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &tz, &tz_len) == FAILURE) { RETURN_FALSE; } - tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC)); - if (SUCCESS != timezone_initialize(tzobj, tz TSRMLS_CC)) { + tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value)); + if (SUCCESS != timezone_initialize(tzobj, tz)) { RETURN_FALSE; } } @@ -3679,18 +3678,18 @@ PHP_METHOD(DateTimeZone, __construct) php_timezone_obj *tzobj; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) { + zend_replace_error_handling(EH_THROW, NULL, &error_handling); + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "s", &tz, &tz_len)) { tzobj = Z_PHPTIMEZONE_P(getThis()); - if (FAILURE == timezone_initialize(tzobj, tz TSRMLS_CC)) { + if (FAILURE == timezone_initialize(tzobj, tz)) { ZEND_CTOR_MAKE_NULL(); } } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ -static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, HashTable *myht TSRMLS_DC) /* {{{ */ +static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, HashTable *myht) /* {{{ */ { zval *z_timezone; zval *z_timezone_type; @@ -3698,7 +3697,7 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez if ((z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1)) != NULL) { if ((z_timezone = zend_hash_str_find(myht, "timezone", sizeof("timezone")-1)) != NULL) { convert_to_long(z_timezone_type); - if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone) TSRMLS_CC)) { + if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone))) { return SUCCESS; } } @@ -3714,15 +3713,15 @@ PHP_METHOD(DateTimeZone, __set_state) zval *array; HashTable *myht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) { RETURN_FALSE; } myht = HASH_OF(array); - php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC); + php_date_instantiate(date_ce_timezone, return_value); tzobj = Z_PHPTIMEZONE_P(return_value); - php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC); + php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht); } /* }}} */ @@ -3738,7 +3737,7 @@ PHP_METHOD(DateTimeZone, __wakeup) myht = Z_OBJPROP_P(object); - php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht TSRMLS_CC); + php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht); } /* }}} */ @@ -3750,7 +3749,7 @@ PHP_FUNCTION(timezone_name_get) zval *object; php_timezone_obj *tzobj; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } tzobj = Z_PHPTIMEZONE_P(object); @@ -3790,7 +3789,7 @@ PHP_FUNCTION(timezone_name_from_abbr) zend_long gmtoffset = -1; zend_long isdst = -1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &abbr, &abbr_len, &gmtoffset, &isdst) == FAILURE) { RETURN_FALSE; } tzid = timelib_timezone_id_from_abbr(abbr, gmtoffset, isdst); @@ -3813,7 +3812,7 @@ 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_interface) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) { RETURN_FALSE; } tzobj = Z_PHPTIMEZONE_P(object); @@ -3847,7 +3846,7 @@ PHP_FUNCTION(timezone_transitions_get) unsigned int i, begin = 0, found; zend_long timestamp_begin = ZEND_LONG_MIN, timestamp_end = ZEND_LONG_MAX; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ll", &object, date_ce_timezone, ×tamp_begin, ×tamp_end) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ll", &object, date_ce_timezone, ×tamp_begin, ×tamp_end) == FAILURE) { RETURN_FALSE; } tzobj = Z_PHPTIMEZONE_P(object); @@ -3859,7 +3858,7 @@ PHP_FUNCTION(timezone_transitions_get) #define add_nominal() \ array_init(&element); \ add_assoc_long(&element, "ts", timestamp_begin); \ - add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0 TSRMLS_CC)); \ + add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0)); \ add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \ add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \ add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx]); \ @@ -3868,7 +3867,7 @@ PHP_FUNCTION(timezone_transitions_get) #define add(i,ts) \ array_init(&element); \ add_assoc_long(&element, "ts", ts); \ - add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0 TSRMLS_CC)); \ + add_assoc_str(&element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0)); \ add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \ add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \ add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx]); \ @@ -3925,7 +3924,7 @@ PHP_FUNCTION(timezone_location_get) zval *object; php_timezone_obj *tzobj; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, date_ce_timezone) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } tzobj = Z_PHPTIMEZONE_P(object); @@ -3942,7 +3941,7 @@ PHP_FUNCTION(timezone_location_get) } /* }}} */ -static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ +static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; @@ -3953,7 +3952,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors); if (errors->error_count > 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format); + php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format); retval = FAILURE; } else { if(p) { @@ -3966,7 +3965,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma *rt = timelib_diff(b, e); retval = SUCCESS; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to parse interval (%s)", format); + php_error_docref(NULL, E_WARNING, "Failed to parse interval (%s)", format); retval = FAILURE; } } @@ -3976,7 +3975,7 @@ static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *forma } /* }}} */ /* {{{ date_interval_read_property */ -zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) +zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) { php_interval_obj *obj; zval *retval; @@ -3994,7 +3993,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c obj = Z_PHPINTERVAL_P(object); if (!obj->initialized) { - retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv TSRMLS_CC); + retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv); if (member == &tmp_member) { zval_dtor(member); } @@ -4016,7 +4015,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c GET_VALUE_FROM_STRUCT(invert, "invert"); GET_VALUE_FROM_STRUCT(days, "days"); /* didn't find any */ - retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv TSRMLS_CC); + retval = (zend_get_std_object_handlers())->read_property(object, member, type, cache_slot, rv); if (member == &tmp_member) { zval_dtor(member); @@ -4042,7 +4041,7 @@ zval *date_interval_read_property(zval *object, zval *member, int type, void **c /* }}} */ /* {{{ date_interval_write_property */ -void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) +void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot) { php_interval_obj *obj; zval tmp_member; @@ -4058,7 +4057,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void obj = Z_PHPINTERVAL_P(object); if (!obj->initialized) { - (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot TSRMLS_CC); + (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot); if (member == &tmp_member) { zval_dtor(member); } @@ -4080,7 +4079,7 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void SET_VALUE_FROM_STRUCT(s, "s"); SET_VALUE_FROM_STRUCT(invert, "invert"); /* didn't find any */ - (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot TSRMLS_CC); + (zend_get_std_object_handlers())->write_property(object, member, value, cache_slot); } while(0); if (member == &tmp_member) { @@ -4101,9 +4100,9 @@ PHP_METHOD(DateInterval, __construct) timelib_rel_time *reltime; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &interval_string, &interval_string_length) == SUCCESS) { - if (date_interval_initialize(&reltime, interval_string, interval_string_length TSRMLS_CC) == SUCCESS) { + zend_replace_error_handling(EH_THROW, NULL, &error_handling); + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &interval_string, &interval_string_length) == SUCCESS) { + if (date_interval_initialize(&reltime, interval_string, interval_string_length) == SUCCESS) { diobj = Z_PHPINTERVAL_P(getThis()); diobj->diff = reltime; diobj->initialized = 1; @@ -4111,12 +4110,12 @@ PHP_METHOD(DateInterval, __construct) ZEND_CTOR_MAKE_NULL(); } } - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ -static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC) /* {{{ */ +static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht) /* {{{ */ { (*intobj)->diff = timelib_rel_time_ctor(); @@ -4170,15 +4169,15 @@ PHP_METHOD(DateInterval, __set_state) zval *array; HashTable *myht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) { RETURN_FALSE; } myht = HASH_OF(array); - php_date_instantiate(date_ce_interval, return_value TSRMLS_CC); + php_date_instantiate(date_ce_interval, return_value); intobj = Z_PHPINTERVAL_P(return_value); - php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC); + php_date_interval_initialize_from_hash(&return_value, &intobj, myht); } /* }}} */ @@ -4194,7 +4193,7 @@ PHP_METHOD(DateInterval, __wakeup) myht = Z_OBJPROP_P(object); - php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC); + php_date_interval_initialize_from_hash(&return_value, &intobj, myht); } /* }}} */ @@ -4209,11 +4208,11 @@ PHP_FUNCTION(date_interval_create_from_date_string) timelib_error_container *err = NULL; php_interval_obj *diobj; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &time_str, &time_str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &time_str, &time_str_len) == FAILURE) { RETURN_FALSE; } - php_date_instantiate(date_ce_interval, return_value TSRMLS_CC); + php_date_instantiate(date_ce_interval, return_value); time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); diobj = Z_PHPINTERVAL_P(return_value); @@ -4225,7 +4224,7 @@ PHP_FUNCTION(date_interval_create_from_date_string) /* }}} */ /* {{{ date_interval_format - */ -static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC) +static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t) { smart_str string = {0}; int i, length, have_format_spec = 0; @@ -4296,17 +4295,17 @@ PHP_FUNCTION(date_interval_format) char *format; size_t format_len; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, date_ce_interval, &format, &format_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &object, date_ce_interval, &format, &format_len) == FAILURE) { RETURN_FALSE; } diobj = Z_PHPINTERVAL_P(object); DATE_CHECK_INITIALIZED(diobj->initialized, DateInterval); - RETURN_STR(date_interval_format(format, format_len, diobj->diff TSRMLS_CC)); + RETURN_STR(date_interval_format(format, format_len, diobj->diff)); } /* }}} */ -static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ +static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; @@ -4317,7 +4316,7 @@ static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_ timelib_strtointerval(format, format_length, &b, &e, &p, &r, &errors); if (errors->error_count > 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or bad format (%s)", format); + php_error_docref(NULL, E_WARNING, "Unknown or bad format (%s)", format); retval = FAILURE; } else { *st = b; @@ -4345,12 +4344,12 @@ PHP_METHOD(DatePeriod, __construct) timelib_time *clone; zend_error_handling error_handling; - zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "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() TSRMLS_CC, "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() TSRMLS_CC, "s|l", &isostr, &isostr_len, &options) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This constructor accepts either (DateTimeInterface, DateInterval, int) OR (DateTimeInterface, DateInterval, DateTime) OR (string) as arguments."); - zend_restore_error_handling(&error_handling TSRMLS_CC); + 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(), "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."); + zend_restore_error_handling(&error_handling); return; } } @@ -4360,15 +4359,15 @@ PHP_METHOD(DatePeriod, __construct) dpobj->current = NULL; if (isostr) { - date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len TSRMLS_CC); + date_period_initialize(&(dpobj->start), &(dpobj->end), &(dpobj->interval), &recurrences, isostr, isostr_len); if (dpobj->start == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr); + php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain a start date.", isostr); } if (dpobj->interval == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an interval.", isostr); + php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain an interval.", isostr); } if (dpobj->end == NULL && recurrences == 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr); + php_error_docref(NULL, E_WARNING, "The ISO interval '%s' did not contain an end date or a recurrence count.", isostr); } if (dpobj->start) { @@ -4414,7 +4413,7 @@ PHP_METHOD(DatePeriod, __construct) dpobj->initialized = 1; - zend_restore_error_handling(&error_handling TSRMLS_CC); + zend_restore_error_handling(&error_handling); } /* }}} */ @@ -4432,7 +4431,7 @@ PHP_METHOD(DatePeriod, getStartDate) dpobj = Z_PHPPERIOD_P(getThis()); - php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC); + php_date_instantiate(dpobj->start_ce, return_value); dateobj = Z_PHPDATE_P(return_value); dateobj->time = timelib_time_ctor(); *dateobj->time = *dpobj->start; @@ -4459,7 +4458,7 @@ PHP_METHOD(DatePeriod, getEndDate) dpobj = Z_PHPPERIOD_P(getThis()); - php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC); + php_date_instantiate(dpobj->start_ce, return_value); dateobj = Z_PHPDATE_P(return_value); dateobj->time = timelib_time_ctor(); *dateobj->time = *dpobj->end; @@ -4486,7 +4485,7 @@ PHP_METHOD(DatePeriod, getDateInterval) dpobj = Z_PHPPERIOD_P(getThis()); - php_date_instantiate(date_ce_interval, return_value TSRMLS_CC); + php_date_instantiate(date_ce_interval, return_value); diobj = Z_PHPINTERVAL_P(return_value); diobj->diff = timelib_rel_time_clone(dpobj->interval); diobj->initialized = 1; @@ -4521,13 +4520,13 @@ PHP_FUNCTION(timezone_identifiers_list) char *option = NULL; size_t option_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &what, &option, &option_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ls", &what, &option, &option_len) == FAILURE) { RETURN_FALSE; } /* Extra validation */ if (what == PHP_DATE_TIMEZONE_PER_COUNTRY && option_len != 2) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "A two-letter ISO 3166-1 compatible country code is expected"); + php_error_docref(NULL, E_NOTICE, "A two-letter ISO 3166-1 compatible country code is expected"); RETURN_FALSE; } @@ -4603,11 +4602,11 @@ PHP_FUNCTION(date_default_timezone_set) char *zone; size_t zone_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &zone, &zone_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &zone, &zone_len) == FAILURE) { RETURN_FALSE; } if (!timelib_timezone_id_is_valid(zone, DATE_TIMEZONEDB)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Timezone ID '%s' is invalid", zone); + php_error_docref(NULL, E_NOTICE, "Timezone ID '%s' is invalid", zone); RETURN_FALSE; } if (DATEG(timezone)) { @@ -4625,7 +4624,7 @@ PHP_FUNCTION(date_default_timezone_get) { timelib_tzinfo *default_tz; - default_tz = get_timezone_info(TSRMLS_C); + default_tz = get_timezone_info(); RETVAL_STRING(default_tz->name); } /* }}} */ @@ -4644,7 +4643,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su timelib_tzinfo *tzi; zend_string *retstr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|ldddd", &time, &retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) { RETURN_FALSE; } @@ -4665,7 +4664,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su case 6: break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid format"); + php_error_docref(NULL, E_WARNING, "invalid format"); RETURN_FALSE; break; } @@ -4673,14 +4672,14 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su retformat != SUNFUNCS_RET_STRING && retformat != SUNFUNCS_RET_DOUBLE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE"); + php_error_docref(NULL, E_WARNING, "Wrong return format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or SUNFUNCS_RET_DOUBLE"); RETURN_FALSE; } altitude = 90 - zenith; /* Initialize time struct */ t = timelib_time_ctor(); - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; @@ -4746,12 +4745,12 @@ PHP_FUNCTION(date_sun_info) int dummy; double ddummy; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd", &time, &latitude, &longitude) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ldd", &time, &latitude, &longitude) == FAILURE) { RETURN_FALSE; } /* Initialize time struct */ t = timelib_time_ctor(); - tzi = get_timezone_info(TSRMLS_C); + tzi = get_timezone_info(); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(t, time); @@ -4838,14 +4837,14 @@ PHP_FUNCTION(date_sun_info) } /* }}} */ -static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_gc_period(zval *object, zval **table, int *n) /* {{{ */ { *table = NULL; *n = 0; - return zend_std_get_properties(object TSRMLS_CC); + return zend_std_get_properties(object); } /* }}} */ -static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {{{ */ +static HashTable *date_object_get_properties_period(zval *object) /* {{{ */ { HashTable *props; zval zv; @@ -4853,7 +4852,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* { period_obj = Z_PHPPERIOD_P(object); - props = zend_std_get_properties(object TSRMLS_CC); + props = zend_std_get_properties(object); if (!period_obj->start || GC_G(gc_active)) { return props; @@ -4910,7 +4909,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* { return props; } /* }}} */ -static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC) /* {{{ */ +static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht) /* {{{ */ { zval *ht_entry; @@ -4998,7 +4997,7 @@ PHP_METHOD(DatePeriod, __set_state) zval *array; HashTable *myht; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &array) == FAILURE) { RETURN_FALSE; } @@ -5006,7 +5005,7 @@ PHP_METHOD(DatePeriod, __set_state) object_init_ex(return_value, date_ce_period); period_obj = Z_PHPPERIOD_P(return_value); - if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) { + if (!php_date_period_initialize_from_hash(period_obj, myht)) { php_error(E_ERROR, "Invalid serialization data for DatePeriod object"); } } @@ -5024,26 +5023,26 @@ PHP_METHOD(DatePeriod, __wakeup) myht = Z_OBJPROP_P(object); - if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) { + if (!php_date_period_initialize_from_hash(period_obj, myht)) { php_error(E_ERROR, "Invalid serialization data for DatePeriod object"); } } /* }}} */ /* {{{ date_period_read_property */ -static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) +static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) { zval *zv; if (type != BP_VAR_IS && type != BP_VAR_R) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported"); + php_error_docref(NULL, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported"); } Z_OBJPROP_P(object); /* build properties hash table */ - zv = std_object_handlers.read_property(object, member, type, cache_slot, rv TSRMLS_CC); + zv = std_object_handlers.read_property(object, member, type, cache_slot, rv); if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) { /* defensive copy */ - ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC)); + ZVAL_OBJ(zv, Z_OBJ_HANDLER_P(zv, clone_obj)(zv)); } return zv; @@ -5051,9 +5050,9 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi /* }}} */ /* {{{ date_period_write_property */ -static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) +static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported"); + php_error_docref(NULL, E_ERROR, "Writing to DatePeriod properties is unsupported"); } /* }}} */ |