again:
switch (Z_TYPE_P(expr)) {
- case IS_NULL:
+ case IS_NULL: {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(expr_copy);
break;
+ }
case IS_BOOL:
if (Z_LVAL_P(expr)) {
// TODO: ??? use interned string
ZVAL_NEW_STR(expr_copy, STR_INIT("1", 1, 0));
} else {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(expr_copy);
}
break;
#ifdef ZTS
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC) /* {{{ */
{
- zend_function tmp_func;
- zend_class_entry *tmp_class;
-
compiler_globals->compiled_filename = NULL;
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
- zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
+ zend_hash_copy(compiler_globals->function_table, global_function_table, NULL);
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0);
- zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL, NULL, sizeof(zend_auto_global) /* empty element */);
+ zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL /* empty element */);
compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table);
if (compiler_globals->last_static_member) {
zend_init_rsrc_plist(TSRMLS_C);
zend_init_exception_op(TSRMLS_C);
EG(lambda_count) = 0;
- EG(user_error_handler) = NULL;
- EG(user_exception_handler) = NULL;
+ ZVAL_UNDEF(&EG(user_error_handler));
+ ZVAL_UNDEF(&EG(user_exception_handler));
EG(in_execution) = 0;
EG(in_autoload) = NULL;
EG(current_execute_data) = NULL;
if (class_type->default_properties_count) {
//??? object->properties_table = emalloc(sizeof(zval*) * class_type->default_properties_count);
for (i = 0; i < class_type->default_properties_count; i++) {
- ZVAL_COPY_VALUE(&object->properties_table[i], &class_type->default_properties_table[i]);
- if (Z_REFCOUNTED(class_type->default_properties_table[i])) {
#if ZTS
- ALLOC_ZVAL( object->properties_table[i]);
- MAKE_COPY_ZVAL(&class_type->default_properties_table[i], object->properties_table[i]);
+ ZVAL_DUP(&object->properties_table[i], &class_type->default_properties_table[i]);
#else
- Z_ADDREF(object->properties_table[i]);
+ ZVAL_COPY(&object->properties_table[i], &class_type->default_properties_table[i]);
#endif
- }
}
object->properties = NULL;
}
}
/* }}} */
-ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties) /* {{{ */
+ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties TSRMLS_DC) /* {{{ */
{
object->properties = properties;
if (object->ce->default_properties_count) {
}
/* }}} */
-ZEND_API void object_properties_load(zend_object *object, HashTable *properties) /* {{{ */
+ZEND_API void object_properties_load(zend_object *object, HashTable *properties TSRMLS_DC) /* {{{ */
{
HashPosition pos;
zval *prop, tmp;
if (class_type->create_object == NULL) {
ZVAL_OBJ(arg, zend_objects_new(class_type TSRMLS_CC));
if (properties) {
- object_properties_init_ex(Z_OBJ_P(arg), properties);
+ object_properties_init_ex(Z_OBJ_P(arg), properties TSRMLS_CC);
} else {
object_properties_init(Z_OBJ_P(arg), class_type);
}
}
/* }}} */
-ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value) /* {{{ */
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC) /* {{{ */
{
zval *result;
while (ptr->fname) {
fname_len = strlen(ptr->fname);
internal_function->handler = ptr->handler;
- internal_function->function_name = zend_new_interned_string(STR_INIT(ptr->fname, fname_len, 1));
+ internal_function->function_name = zend_new_interned_string(STR_INIT(ptr->fname, fname_len, 1) TSRMLS_CC);
internal_function->scope = scope;
internal_function->prototype = NULL;
if (ptr->flags) {
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC);
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type);
-ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties);
-ZEND_API void object_properties_load(zend_object *object, HashTable *properties);
+ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properties TSRMLS_DC);
+ZEND_API void object_properties_load(zend_object *object, HashTable *properties TSRMLS_DC);
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC);
ZEND_API zval *add_get_index_string(zval *arg, ulong idx, const char *str, int duplicate);
ZEND_API zval *add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, int duplicate);
-ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value);
+ZEND_API int array_set_zval_key(HashTable *ht, zval *key, zval *value TSRMLS_DC);
ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
if (ptr->function_state.arguments) {
zval args;
debug_backtrace_get_args(ptr->function_state.arguments, &args TSRMLS_CC);
- add_assoc_zval_ex(&stack_frame, "args", sizeof("args")-1, &args TSRMLS_CC);
+ add_assoc_zval_ex(&stack_frame, "args", sizeof("args")-1, &args);
}
}
} else {
/* }}} */
#ifdef ZTS
-static void zval_internal_ctor(zval **p) /* {{{ */
-{
- zval *orig_ptr = *p;
-
- ALLOC_ZVAL(*p);
- MAKE_COPY_ZVAL(&orig_ptr, *p);
-}
-/* }}} */
-
# define zval_property_ctor(parent_ce, ce) \
- (((parent_ce)->type != (ce)->type) ? zval_internal_ctor : zval_add_ref))
+ (((parent_ce)->type != (ce)->type) ? ZVAL_COPY_CTOR : zval_add_ref)
#else
# define zval_property_ctor(parent_ce, ce) \
zval_add_ref
}
}
for (i = 0; i < parent_ce->default_properties_count; i++) {
- ZVAL_COPY_VALUE(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
- if (Z_REFCOUNTED(ce->default_properties_table[i])) {
#ifdef ZTS
- if (parent_ce->type != ce->type) {
- zval *p;
-
- ALLOC_ZVAL(p);
- MAKE_COPY_ZVAL(&ce->default_properties_table[i], p);
- ce->default_properties_table[i] = p;
- } else {
- Z_ADDREF_P(ce->default_properties_table[i]);
- }
-#else
- Z_ADDREF(ce->default_properties_table[i]);
-#endif
+ if (parent_ce->type != ce->type) {
+ ZVAL_DUP(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
+ continue;
}
+#endif
+
+ ZVAL_COPY(&ce->default_properties_table[i], &parent_ce->default_properties_table[i]);
}
ce->default_properties_count += parent_ce->default_properties_count;
}
}
/* }}} */
-void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr) /* {{{ */
+void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr TSRMLS_DC) /* {{{ */
{
zval element;
void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
-void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr);
+void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr TSRMLS_DC);
void zend_do_list_init(TSRMLS_D);
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
void zend_do_add_list_element(const znode *element TSRMLS_DC);
zend_bool encoding_declared;
#ifdef ZTS
- zval ***static_members_table;
+ zval **static_members_table;
int last_static_member;
#endif
};
#ifdef ZTS
ZEND_API int zend_copy_ini_directives(TSRMLS_D) /* {{{ */
{
- zend_ini_entry ini_entry;
-
EG(modified_ini_directives) = NULL;
EG(error_reporting_ini_entry) = NULL;
EG(ini_directives) = (HashTable *) malloc(sizeof(HashTable));
if (zend_hash_init_ex(EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0) == FAILURE) {
return FAILURE;
}
- zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
+ zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL);
return SUCCESS;
}
/* }}} */
ZEND_API void zend_iterator_init(zend_object_iterator *iter TSRMLS_DC)
{
- zend_object_std_init(&iter->std, &zend_iterator_class_entry);
+ zend_object_std_init(&iter->std, &zend_iterator_class_entry TSRMLS_CC);
iter->std.handlers = &iterator_object_handlers;
}
;
non_empty_static_array_pair_list:
- non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
- | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
- | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
- | static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
+ non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5 TSRMLS_CC); }
+ | non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3 TSRMLS_CC); }
+ | static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3 TSRMLS_CC); }
+ | static_scalar { $$.op_type = IS_CONST; array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1 TSRMLS_CC); }
;
expr:
object->ce = ce;
object->properties = NULL;
object->guards = NULL;
- zend_objects_store_put(object);
+ zend_objects_store_put(object TSRMLS_CC);
if (EXPECTED(ce->default_properties_count != 0)) {
zval *p = object->properties_table;
zval *end = p + ce->default_properties_count;
{
zend_object *object = emalloc(sizeof(zend_object) + sizeof(zval) * (ce->default_properties_count - 1));
- zend_object_std_init(object, ce);
+ zend_object_std_init(object, ce TSRMLS_CC);
object->handlers = &std_object_handlers;
return object;
}
double dval;
switch (Z_TYPE_P(op)) {
- case IS_NULL:
+ case IS_NULL: {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(op);
break;
+ }
case IS_STRING:
break;
case IS_BOOL:
if (Z_LVAL_P(op)) {
ZVAL_NEW_STR(op, STR_INIT("1", 1, 0));
} else {
+ TSRMLS_FETCH();
ZVAL_EMPTY_STRING(op);
}
break;
void zend_interned_strings_init(TSRMLS_D)
{
-#ifndef ZTS
zend_string *str;
+#ifndef ZTS
zend_hash_init(&CG(interned_strings), 0, NULL, _str_dtor, 1);
CG(interned_strings).nTableMask = CG(interned_strings).nTableSize - 1;
/* }}} */
/* {{{ date_format - (gm)date helper */
-static zend_string *date_format(char *format, int format_len, timelib_time *t, int localtime)
+static zend_string *date_format(char *format, int format_len, timelib_time *t, int localtime TSRMLS_DC)
{
smart_str string = {0};
int i, length = 0;
timelib_unixtime2gmt(t, ts);
}
- string = date_format(format, format_len, t, localtime);
+ string = date_format(format, format_len, t, localtime TSRMLS_CC);
timelib_time_dtor(t);
return string;
}
/* first we add the date and time in ISO format */
- ZVAL_STR(&zv, date_format("Y-m-d H:i:s", sizeof("Y-m-d H:i:s")-1, dateobj->time, 1));
+ ZVAL_STR(&zv, date_format("Y-m-d H:i:s", sizeof("Y-m-d H:i:s")-1, dateobj->time, 1 TSRMLS_CC));
zend_hash_str_update(props, "date", sizeof("date")-1, &zv);
/* then we add the timezone name (or similar) */
}
dateobj = Z_PHPDATE_P(object);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
- RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime));
+ RETURN_STR(date_format(format, format_len, dateobj->time, dateobj->time->is_localtime TSRMLS_CC));
}
/* }}} */
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO|l", &object1, date_ce_interface, &object2, date_ce_interface, &absolute) == FAILURE) {
RETURN_FALSE;
}
- dateobj1 = Z_PHPDATE_P(object1 TSRMLS_CC);
- dateobj2 = Z_PHPDATE_P(object2 TSRMLS_CC);
+ dateobj1 = Z_PHPDATE_P(object1);
+ dateobj2 = Z_PHPDATE_P(object2);
DATE_CHECK_INITIALIZED(dateobj1->time, DateTimeInterface);
DATE_CHECK_INITIALIZED(dateobj2->time, DateTimeInterface);
timelib_update_ts(dateobj1->time, NULL);
timelib_update_ts(dateobj2->time, NULL);
php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
- interval = Z_PHPINTERVAL_P(return_value TSRMLS_CC);
+ interval = Z_PHPINTERVAL_P(return_value);
interval->diff = timelib_diff(dateobj1->time, dateobj2->time);
if (absolute) {
interval->diff->invert = 0;
if (SUCCESS != timezone_initialize(&tzi, tz TSRMLS_CC)) {
RETURN_FALSE;
}
- tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC) TSRMLS_CC);
+ tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value TSRMLS_CC));
tzobj->type = TIMELIB_ZONETYPE_ID;
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
/* }}} */
/* {{{ date_interval_format - */
-static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t)
+static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t TSRMLS_DC)
{
smart_str string = {0};
int i, length, have_format_spec = 0;
diobj = Z_PHPINTERVAL_P(object);
DATE_CHECK_INITIALIZED(diobj->initialized, DateInterval);
- RETURN_STR(date_interval_format(format, format_len, diobj->diff));
+ RETURN_STR(date_interval_format(format, format_len, diobj->diff TSRMLS_CC));
}
/* }}} */
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1) TSRMLS_CC) == NULL) {
+ if ((name = _default_load_entry(getThis(), "name", sizeof("name")-1 TSRMLS_CC)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
}
/* copy members */
- object_properties_load(&intern->std, Z_ARRVAL(members));
+ object_properties_load(&intern->std, Z_ARRVAL(members) TSRMLS_CC);
zval_ptr_dtor(&members);
/* done reading $serialized */
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object);
+ iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_dir_it_funcs;
/* ->current must be initialized; rewind doesn't set it and valid
/* {{{ spl_filesystem_dir_it_valid */
static int spl_filesystem_dir_it_valid(zend_object_iterator *iter TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
return object->u.dir.entry.d_name[0] != '\0' ? SUCCESS : FAILURE;
}
/* {{{ spl_filesystem_dir_it_current_key */
static void spl_filesystem_dir_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
ZVAL_LONG(key, object->u.dir.index);
}
/* {{{ spl_filesystem_dir_it_move_forward */
static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
object->u.dir.index++;
spl_filesystem_dir_read(object TSRMLS_CC);
/* {{{ spl_filesystem_dir_it_rewind */
static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
static zval *spl_filesystem_tree_it_current_data(zend_object_iterator *iter TSRMLS_DC)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
if (SPL_FILE_DIR_CURRENT(object, SPL_FILE_DIR_CURRENT_AS_PATHNAME)) {
if (ZVAL_IS_UNDEF(&iterator->current)) {
/* {{{ spl_filesystem_tree_it_current_key */
static void spl_filesystem_tree_it_current_key(zend_object_iterator *iter, zval *key TSRMLS_DC)
{
- spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object((spl_filesystem_iterator *)iter TSRMLS_CC);
if (SPL_FILE_DIR_KEY(object, SPL_FILE_DIR_KEY_AS_FILENAME)) {
ZVAL_STRING(key, object->u.dir.entry.d_name);
static void spl_filesystem_tree_it_move_forward(zend_object_iterator *iter TSRMLS_DC)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
object->u.dir.index++;
do {
static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter TSRMLS_DC)
{
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
- spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator);
+ spl_filesystem_object *object = spl_filesystem_iterator_to_object(iterator TSRMLS_CC);
object->u.dir.index = 0;
if (object->u.dir.dirp) {
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
dir_object = Z_SPLFILESYSTEM_P(object);
- iterator = spl_filesystem_object_to_iterator(dir_object);
+ iterator = spl_filesystem_object_to_iterator(dir_object TSRMLS_CC);
ZVAL_COPY(&iterator->intern.data, object);
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
int i;
for (i=0; i < heap->count; ++i) {
- heap->dtor(&heap->elements[i]);
+ heap->dtor(&heap->elements[i] TSRMLS_CC);
}
efree(heap->elements);
ZVAL_ZVAL(&zcacheval, &intern->current.data, 1, 0);
- array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval);
+ array_set_zval_key(HASH_OF(&intern->u.caching.zcache), key, &zcacheval TSRMLS_CC);
zval_ptr_dtor(&zcacheval);
}
if (EG(exception)) {
return ZEND_HASH_APPLY_STOP;
}
- array_set_zval_key(Z_ARRVAL_P(return_value), &key, data);
+ array_set_zval_key(Z_ARRVAL_P(return_value), &key, data TSRMLS_CC);
zval_dtor(&key);
} else {
Z_ADDREF_P(data);
* Convert a long to a string containing a base(2-36) representation of
* the number.
*/
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base)
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC)
{
static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
char buf[(sizeof(unsigned long) << 3) + 1];
return STR_INIT(ptr, end - ptr, 0);
}
- return _php_math_longtobase(arg, base);
+ return _php_math_longtobase(arg, base TSRMLS_CC);
}
/* }}} */
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 2);
+ result = _php_math_longtobase(arg, 2 TSRMLS_CC);
RETURN_STR(result);
}
/* }}} */
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 8);
+ result = _php_math_longtobase(arg, 8 TSRMLS_CC);
RETURN_STR(result);
}
/* }}} */
return;
}
convert_to_long_ex(arg);
- result = _php_math_longtobase(arg, 16);
+ result = _php_math_longtobase(arg, 16 TSRMLS_CC);
RETURN_STR(result);
}
/* }}} */
PHPAPI zend_string *_php_math_number_format(double, int, char, char);
PHPAPI zend_string *_php_math_number_format_ex(double, int, char *, size_t, char *, size_t);
-PHPAPI zend_string * _php_math_longtobase(zval *arg, int base);
+PHPAPI zend_string * _php_math_longtobase(zval *arg, int base TSRMLS_DC);
PHPAPI long _php_math_basetolong(zval *arg, int base);
PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret);
PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base TSRMLS_DC);
while ((tmp_str = zend_hash_get_current_data_ex(Z_ARRVAL_P(str), &pos_str)) != NULL) {
zval *orig_str;
zval dummy;
- ulong refcount;
if (Z_ISREF_P(tmp_str)) {
/* see bug #55871 */
/* }}} */
/* {{{ php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value) */
-static void php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value)
+static void php_strtr_array_do_repl(STR *text, PPRES *d, zval *return_value TSRMLS_DC)
{
STRLEN pos = 0,
nextwpos = 0,
/* }}} */
/* {{{ php_strtr_array */
-static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *pats)
+static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *pats TSRMLS_DC)
{
PPRES *data;
STR text;
}
data = php_strtr_array_prepare(&text, patterns, patterns_len, 2, 2);
efree(patterns);
- php_strtr_array_do_repl(&text, data, return_value);
+ php_strtr_array_do_repl(&text, data, return_value TSRMLS_CC);
php_strtr_array_destroy_ppres(data);
zend_llist_destroy(allocs);
efree(allocs);
}
if (ac == 2) {
- php_strtr_array(return_value, str, str_len, HASH_OF(from));
+ php_strtr_array(return_value, str, str_len, HASH_OF(from) TSRMLS_CC);
} else {
convert_to_string_ex(from);
/* {{{ php_str_replace_in_subject
*/
-static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, int *replace_count)
+static void php_str_replace_in_subject(zval *search, zval *replace, zval *subject, zval *result, int case_sensitivity, int *replace_count TSRMLS_DC)
{
zval *search_entry,
*replace_entry = NULL,
and add the result to the return_value array. */
while ((subject_entry = zend_hash_get_current_data(Z_ARRVAL_P(subject))) != NULL) {
if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) {
- php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL);
+ php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
} else {
Z_ADDREF_P(subject_entry);
COPY_PZVAL_TO_ZVAL(result, subject_entry);
zend_hash_move_forward(Z_ARRVAL_P(subject));
}
} else { /* if subject is not an array */
- php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL);
+ php_str_replace_in_subject(search, replace, subject, return_value, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC);
}
if (argc > 3) {
zval_dtor(Z_REFVAL_P(zcount));