Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

More TSRMLS_FETCH work

  • Loading branch information...
commit d76cf1da183f79711d7699a2ff85f743da3f9dd2 1 parent 7bc71f4
authored July 31, 2001

Showing 49 changed files with 261 additions and 283 deletions. Show diff stats Hide diff stats

  1. 10  Zend/zend.c
  2. 2  Zend/zend.h
  3. 17  Zend/zend_API.c
  4. 2  Zend/zend_API.h
  5. 10  Zend/zend_builtin_functions.c
  6. 2  Zend/zend_compile.c
  7. 6  Zend/zend_compile.h
  8. 8  Zend/zend_constants.c
  9. 32  Zend/zend_execute.c
  10. 2  Zend/zend_execute.h
  11. 21  Zend/zend_execute_API.c
  12. 12  Zend/zend_extensions.c
  13. 2  Zend/zend_extensions.h
  14. 6  Zend/zend_hash.c
  15. 6  Zend/zend_hash.h
  16. 20  Zend/zend_ini.c
  17. 14  Zend/zend_list.c
  18. 2  Zend/zend_list.h
  19. 12  Zend/zend_llist.c
  20. 12  Zend/zend_llist.h
  21. 4  Zend/zend_modules.h
  22. 20  Zend/zend_opcode.c
  23. 1  ext/crack/crack.c
  24. 122  ext/domxml/php_domxml.c
  25. 11  ext/dotnet/dotnet.cpp
  26. 1  ext/fdf/fdf.c
  27. 2  ext/mbstring/mbstring.c
  28. 6  ext/mssql/php_mssql.c
  29. 32  ext/oci8/oci8.c
  30. 7  ext/odbc/php_odbc.c
  31. 5  ext/pgsql/pgsql.c
  32. 11  ext/rpc/dotnet/dotnet.cpp
  33. 10  ext/standard/basic_functions.c
  34. 7  ext/standard/info.c
  35. 4  ext/sybase/php_sybase_db.c
  36. 6  ext/sybase_ct/php_sybase_ct.c
  37. 8  main/SAPI.c
  38. 2  main/SAPI.h
  39. 12  main/main.c
  40. 14  main/php_ini.c
  41. 2  main/php_ini.h
  42. 5  main/php_ticks.c
  43. 4  main/rfc1867.c
  44. 6  sapi/apache/mod_php4.c
  45. 17  sapi/cgi/cgi_main.c
  46. 2  sapi/fastcgi/fastcgi.c
  47. 12  sapi/isapi/php4isapi.c
  48. 10  sapi/pi3web/pi3web_sapi.c
  49. 3  sapi/servlet/servlet.c
10  Zend/zend.c
@@ -431,7 +431,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
431 431
 }
432 432
 
433 433
 
434  
-void zend_shutdown()
  434
+void zend_shutdown(TSRMLS_D)
435 435
 {
436 436
 #ifdef ZEND_WIN32
437 437
 	zend_shutdown_timeout_thread();
@@ -445,7 +445,7 @@ void zend_shutdown()
445 445
 	free(GLOBAL_FUNCTION_TABLE);
446 446
 	zend_hash_destroy(GLOBAL_CLASS_TABLE);
447 447
 	free(GLOBAL_CLASS_TABLE);
448  
-	zend_shutdown_extensions();
  448
+	zend_shutdown_extensions(TSRMLS_C);
449 449
 	free(zend_version_info);
450 450
 #ifndef ZTS
451 451
 	zend_shutdown_constants();
@@ -520,9 +520,9 @@ void zend_activate(TSRMLS_D)
520 520
 }
521 521
 
522 522
 
523  
-void zend_activate_modules(void)
  523
+void zend_activate_modules(TSRMLS_D)
524 524
 {
525  
-	zend_hash_apply(&module_registry, (apply_func_t) module_registry_request_startup);
  525
+	zend_hash_apply(&module_registry, (apply_func_t) module_registry_request_startup TSRMLS_CC);
526 526
 }
527 527
 
528 528
 void zend_deactivate_modules(TSRMLS_D)
@@ -530,7 +530,7 @@ void zend_deactivate_modules(TSRMLS_D)
530 530
 	EG(opline_ptr) = NULL; /* we're no longer executing anything */
531 531
 
532 532
 	zend_try {
533  
-		zend_hash_apply(&module_registry, (apply_func_t) module_registry_cleanup);
  533
+		zend_hash_apply(&module_registry, (apply_func_t) module_registry_cleanup TSRMLS_CC);
534 534
 	} zend_end_try();
535 535
 }
536 536
 
2  Zend/zend.h
@@ -304,7 +304,7 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
304 304
 #define BYREF_FORCE_REST 3
305 305
 
306 306
 int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions);
307  
-void zend_shutdown(void);
  307
+void zend_shutdown(TSRMLS_D);
308 308
 
309 309
 void zend_set_utility_values(zend_utility_values *utility_values);
310 310
 
17  Zend/zend_API.c
@@ -569,9 +569,10 @@ ZEND_API int _array_init(zval *arg ZEND_FILE_LINE_DC)
569 569
 ZEND_API int _object_init_ex(zval *arg, zend_class_entry *class_type ZEND_FILE_LINE_DC)
570 570
 {
571 571
 	zval *tmp;
  572
+	TSRMLS_FETCH();
572 573
 
573 574
 	if (!class_type->constants_updated) {
574  
-		zend_hash_apply_with_argument(&class_type->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
  575
+		zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
575 576
 		class_type->constants_updated = 1;
576 577
 	}
577 578
 	
@@ -1100,7 +1101,7 @@ void module_destructor(zend_module_entry *module)
1100 1101
 	TSRMLS_FETCH();
1101 1102
 
1102 1103
 	if (module->type == MODULE_TEMPORARY) {
1103  
-		zend_clean_module_rsrc_dtors(module->module_number);
  1104
+		zend_clean_module_rsrc_dtors(module->module_number TSRMLS_CC);
1104 1105
 		clean_module_constants(module->module_number TSRMLS_CC);
1105 1106
 		if (module->request_shutdown_func)
1106 1107
 			module->request_shutdown_func(module->type, module->module_number TSRMLS_CC);
@@ -1126,11 +1127,9 @@ void module_destructor(zend_module_entry *module)
1126 1127
 
1127 1128
 
1128 1129
 /* call request startup for all modules */
1129  
-int module_registry_request_startup(zend_module_entry *module)
  1130
+int module_registry_request_startup(zend_module_entry *module TSRMLS_DC)
1130 1131
 {
1131 1132
 	if (module->request_startup_func) {
1132  
-		TSRMLS_FETCH();
1133  
-
1134 1133
 #if 0
1135 1134
 		zend_printf("%s:  Request startup\n",module->name);
1136 1135
 #endif
@@ -1146,10 +1145,8 @@ int module_registry_request_startup(zend_module_entry *module)
1146 1145
 /* for persistent modules - call request shutdown and flag NOT to erase
1147 1146
  * for temporary modules - do nothing, and flag to erase
1148 1147
  */
1149  
-int module_registry_cleanup(zend_module_entry *module)
  1148
+int module_registry_cleanup(zend_module_entry *module TSRMLS_DC)
1150 1149
 {
1151  
-	TSRMLS_FETCH();
1152  
-
1153 1150
 	switch(module->type) {
1154 1151
 		case MODULE_PERSISTENT:
1155 1152
 			if (module->request_shutdown_func) {
@@ -1271,10 +1268,8 @@ static zend_function_entry disabled_function[] =  {
1271 1268
 };
1272 1269
 
1273 1270
 
1274  
-ZEND_API int zend_disable_function(char *function_name, uint function_name_length)
  1271
+ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC)
1275 1272
 {
1276  
-	TSRMLS_FETCH();
1277  
-
1278 1273
 	if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
1279 1274
 		return FAILURE;
1280 1275
 	}
2  Zend/zend_API.h
@@ -130,7 +130,7 @@ ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_
130 130
 ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
131 131
 
132 132
 ZEND_API zend_module_entry *zend_get_module(int module_number);
133  
-ZEND_API int zend_disable_function(char *function_name, uint function_name_length);
  133
+ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
134 134
 
135 135
 ZEND_API void zend_wrong_param_count(TSRMLS_D);
136 136
 ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
10  Zend/zend_builtin_functions.c
@@ -553,7 +553,7 @@ ZEND_FUNCTION(get_class_vars)
553 553
 		efree(lcname);
554 554
 		array_init(return_value);
555 555
 		if (!ce->constants_updated) {
556  
-			zend_hash_apply_with_argument(&ce->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
  556
+			zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
557 557
 			ce->constants_updated = 1;
558 558
 		}
559 559
 		zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
@@ -1008,14 +1008,14 @@ ZEND_FUNCTION(get_resource_type)
1008 1008
 }
1009 1009
 
1010 1010
 
1011  
-static int add_extension_info(zend_module_entry *module, void *arg)
  1011
+static int add_extension_info(zend_module_entry *module, void *arg TSRMLS_DC)
1012 1012
 {
1013 1013
 	zval *name_array = (zval *)arg;
1014 1014
 	add_next_index_string(name_array, module->name, 1);
1015 1015
 	return 0;
1016 1016
 }
1017 1017
 
1018  
-static int add_constant_info(zend_constant *constant, void *arg)
  1018
+static int add_constant_info(zend_constant *constant, void *arg TSRMLS_DC)
1019 1019
 {
1020 1020
 	zval *name_array = (zval *)arg;
1021 1021
 	zval *const_val;
@@ -1037,7 +1037,7 @@ ZEND_FUNCTION(get_loaded_extensions)
1037 1037
 	}
1038 1038
 
1039 1039
 	array_init(return_value);
1040  
-	zend_hash_apply_with_argument(&module_registry, (int (*)(void *, void*)) add_extension_info, return_value);
  1040
+	zend_hash_apply_with_argument(&module_registry, (apply_func_arg_t) add_extension_info, return_value TSRMLS_CC);
1041 1041
 }
1042 1042
 /* }}} */
1043 1043
 
@@ -1051,7 +1051,7 @@ ZEND_FUNCTION(get_defined_constants)
1051 1051
 	}
1052 1052
 
1053 1053
 	array_init(return_value);
1054  
-	zend_hash_apply_with_argument(EG(zend_constants), (int (*)(void *, void*)) add_constant_info, return_value);
  1054
+	zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) add_constant_info, return_value TSRMLS_CC);
1055 1055
 }
1056 1056
 
1057 1057
 
2  Zend/zend_compile.c
@@ -766,7 +766,7 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
766 766
 {
767 767
 	zend_do_extended_info(TSRMLS_C);
768 768
 	zend_do_return(NULL, 0 TSRMLS_CC);
769  
-	pass_two(CG(active_op_array));
  769
+	pass_two(CG(active_op_array) TSRMLS_CC);
770 770
 	CG(active_op_array) = function_token->u.op_array;
771 771
 
772 772
 	/* Pop the switch and foreach seperators */
6  Zend/zend_compile.h
@@ -204,7 +204,7 @@ extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handl
204 204
 
205 205
 void zend_activate(TSRMLS_D);
206 206
 void zend_deactivate(TSRMLS_D);
207  
-void zend_activate_modules(void);
  207
+void zend_activate_modules(TSRMLS_D);
208 208
 void zend_deactivate_modules(TSRMLS_D);
209 209
 
210 210
 
@@ -383,9 +383,9 @@ void zend_class_add_ref(zend_class_entry *ce);
383 383
 zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC);
384 384
 void init_op(zend_op *op TSRMLS_DC);
385 385
 int get_next_op_number(zend_op_array *op_array);
386  
-int print_class(zend_class_entry *class_entry);
  386
+int print_class(zend_class_entry *class_entry TSRMLS_DC);
387 387
 void print_op_array(zend_op_array *op_array, int optimizations);
388  
-int pass_two(zend_op_array *op_array);
  388
+int pass_two(zend_op_array *op_array TSRMLS_DC);
389 389
 zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
390 390
 ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
391 391
 ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC);
8  Zend/zend_constants.c
@@ -51,7 +51,7 @@ void zend_copy_constants(HashTable *target, HashTable *source)
51 51
 }
52 52
 
53 53
 
54  
-static int clean_non_persistent_constant(zend_constant *c)
  54
+static int clean_non_persistent_constant(zend_constant *c TSRMLS_DC)
55 55
 {
56 56
 	if (c->flags & CONST_PERSISTENT) {
57 57
 		return 0;
@@ -61,7 +61,7 @@ static int clean_non_persistent_constant(zend_constant *c)
61 61
 }
62 62
 
63 63
 
64  
-static int clean_module_constant(zend_constant *c, int *module_number)
  64
+static int clean_module_constant(zend_constant *c, int *module_number TSRMLS_DC)
65 65
 {
66 66
 	if (c->module_number == *module_number) {
67 67
 		return 1;
@@ -73,7 +73,7 @@ static int clean_module_constant(zend_constant *c, int *module_number)
73 73
 
74 74
 void clean_module_constants(int module_number TSRMLS_DC)
75 75
 {
76  
-	zend_hash_apply_with_argument(EG(zend_constants), (int (*)(void *,void *)) clean_module_constant, (void *) &module_number);
  76
+	zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) clean_module_constant, (void *) &module_number TSRMLS_CC);
77 77
 }
78 78
 
79 79
 
@@ -156,7 +156,7 @@ int zend_shutdown_constants(TSRMLS_D)
156 156
 
157 157
 void clean_non_persistent_constants(TSRMLS_D)
158 158
 {
159  
-	zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant);
  159
+	zend_hash_apply(EG(zend_constants), (apply_func_t) clean_non_persistent_constant TSRMLS_CC);
160 160
 }
161 161
 
162 162
 
32  Zend/zend_execute.c
@@ -61,9 +61,9 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
61 61
 static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC);
62 62
 static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type TSRMLS_DC);
63 63
 static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1, znode *op2, temp_variable *Ts TSRMLS_DC);
64  
-static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array);
65  
-static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array);
66  
-static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array);
  64
+static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
  65
+static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
  66
+static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
67 67
 
68 68
 #define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
69 69
 
@@ -473,7 +473,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
473 473
 
474 474
 
475 475
 /* Utility Functions for Extensions */
476  
-static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array)
  476
+static void zend_extension_statement_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
477 477
 {
478 478
 	if (extension->statement_handler) {
479 479
 		extension->statement_handler(op_array);
@@ -481,7 +481,7 @@ static void zend_extension_statement_handler(zend_extension *extension, zend_op_
481 481
 }
482 482
 
483 483
 
484  
-static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array)
  484
+static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
485 485
 {
486 486
 	if (extension->fcall_begin_handler) {
487 487
 		extension->fcall_begin_handler(op_array);
@@ -489,7 +489,7 @@ static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_o
489 489
 }
490 490
 
491 491
 
492  
-static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array)
  492
+static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
493 493
 {
494 494
 	if (extension->fcall_end_handler) {
495 495
 		extension->fcall_end_handler(op_array);
@@ -561,7 +561,7 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
561 561
 	if (op2->u.fetch_type == ZEND_FETCH_LOCAL) {
562 562
 		FREE_OP(op1, free_op1);
563 563
 	} else if (op2->u.fetch_type == ZEND_FETCH_STATIC) {
564  
-		zval_update_constant(retval, (void *) 1);
  564
+		zval_update_constant(retval, (void *) 1 TSRMLS_CC);
565 565
 	}
566 566
 
567 567
 	if (varname == &tmp_varname) {
@@ -937,19 +937,19 @@ static void call_overloaded_function(temp_variable *T, int arg_count, zval *retu
937 937
 #if ZEND_INTENSIVE_DEBUGGING
938 938
 
939 939
 #define CHECK_SYMBOL_TABLES()														\
940  
-	zend_hash_apply(&EG(symbol_table), (apply_func_t) zend_check_symbol);				\
  940
+	zend_hash_apply(&EG(symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC);	\
941 941
 	if (&EG(symbol_table)!=EG(active_symbol_table)) {								\
942  
-		zend_hash_apply(EG(active_symbol_table), (apply_func_t) zend_check_symbol);	\
  942
+		zend_hash_apply(EG(active_symbol_table), (apply_func_t) zend_check_symbol TSRMLS_CC);	\
943 943
 	}
944 944
 
945  
-static int zend_check_symbol(zval **pz)
  945
+static int zend_check_symbol(zval **pz TSRMLS_DC)
946 946
 {
947 947
 	if ((*pz)->type>9) {
948 948
 		fprintf(stderr, "Warning!  %x has invalid type!\n", *pz);
949 949
 	} else if ((*pz)->type==IS_ARRAY) {
950  
-		zend_hash_apply((*pz)->value.ht, (apply_func_t) zend_check_symbol);
  950
+		zend_hash_apply((*pz)->value.ht, (apply_func_t) zend_check_symbol TSRMLS_CC);
951 951
 	} else if ((*pz)->type==IS_OBJECT) {
952  
-		zend_hash_apply((*pz)->value.obj.properties, (apply_func_t) zend_check_symbol);
  952
+		zend_hash_apply((*pz)->value.obj.properties, (apply_func_t) zend_check_symbol TSRMLS_CC);
953 953
 	}
954 954
 
955 955
 	return 0;
@@ -1793,7 +1793,7 @@ binary_assign_op_addr: {
1793 1793
 								zval_copy_ctor(default_value);
1794 1794
 							}
1795 1795
 							default_value->refcount=1;
1796  
-							zval_update_constant(&default_value, 0);
  1796
+							zval_update_constant(&default_value, 0 TSRMLS_CC);
1797 1797
 							default_value->refcount=0;
1798 1798
 							default_value->is_ref=0;
1799 1799
 							param = &default_value;
@@ -2375,17 +2375,17 @@ binary_assign_op_addr: {
2375 2375
 				NEXT_OPCODE();
2376 2376
 			case ZEND_EXT_STMT: 
2377 2377
 				if (!EG(no_extensions)) {
2378  
-					zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_statement_handler, op_array);
  2378
+					zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_statement_handler, op_array TSRMLS_CC);
2379 2379
 				}
2380 2380
 				NEXT_OPCODE();
2381 2381
 			case ZEND_EXT_FCALL_BEGIN:
2382 2382
 				if (!EG(no_extensions)) {
2383  
-					zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_fcall_begin_handler, op_array);
  2383
+					zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_begin_handler, op_array TSRMLS_CC);
2384 2384
 				}
2385 2385
 				NEXT_OPCODE();
2386 2386
 			case ZEND_EXT_FCALL_END:
2387 2387
 				if (!EG(no_extensions)) {
2388  
-					zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_fcall_end_handler, op_array);
  2388
+					zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_fcall_end_handler, op_array TSRMLS_CC);
2389 2389
 				}
2390 2390
 				NEXT_OPCODE();
2391 2391
 			case ZEND_DECLARE_FUNCTION_OR_CLASS:
2  Zend/zend_execute.h
@@ -101,7 +101,7 @@ static inline int i_zend_is_true(zval *op)
101 101
 	return result;
102 102
 }
103 103
 
104  
-ZEND_API int zval_update_constant(zval **pp, void *arg);
  104
+ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
105 105
 
106 106
 /* dedicated Zend executor functions - do not use! */
107 107
 static inline void zend_ptr_stack_clear_multiple(TSRMLS_D)
21  Zend/zend_execute_API.c
@@ -74,7 +74,7 @@ static void zend_handle_sigsegv(int dummy)
74 74
 #endif
75 75
 
76 76
 
77  
-static void zend_extension_activator(zend_extension *extension)
  77
+static void zend_extension_activator(zend_extension *extension TSRMLS_DC)
78 78
 {
79 79
 	if (extension->activate) {
80 80
 		extension->activate();
@@ -82,7 +82,7 @@ static void zend_extension_activator(zend_extension *extension)
82 82
 }
83 83
 
84 84
 
85  
-static void zend_extension_deactivator(zend_extension *extension)
  85
+static void zend_extension_deactivator(zend_extension *extension TSRMLS_DC)
86 86
 {
87 87
 	if (extension->deactivate) {
88 88
 		extension->deactivate();
@@ -90,13 +90,13 @@ static void zend_extension_deactivator(zend_extension *extension)
90 90
 }
91 91
 
92 92
 
93  
-static int is_not_internal_function(zend_function *function)
  93
+static int is_not_internal_function(zend_function *function TSRMLS_DC)
94 94
 {
95 95
 	return(function->type != ZEND_INTERNAL_FUNCTION);
96 96
 }
97 97
 
98 98
 
99  
-static int is_not_internal_class(zend_class_entry *ce)
  99
+static int is_not_internal_class(zend_class_entry *ce TSRMLS_DC)
100 100
 {
101 101
 	return(ce->type != ZEND_INTERNAL_CLASS);
102 102
 }
@@ -130,7 +130,7 @@ void init_executor(TSRMLS_D)
130 130
 	zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
131 131
 	EG(active_symbol_table) = &EG(symbol_table);
132 132
 
133  
-	zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_activator);
  133
+	zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_activator TSRMLS_CC);
134 134
 	EG(opline_ptr) = NULL;
135 135
 	EG(garbage_ptr) = 0;
136 136
 
@@ -160,7 +160,7 @@ void shutdown_executor(TSRMLS_D)
160 160
 			efree(*EG(symtable_cache_ptr));
161 161
 			EG(symtable_cache_ptr)--;
162 162
 		}
163  
-		zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_deactivator);
  163
+		zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
164 164
 
165 165
 		zend_hash_destroy(&EG(symbol_table));
166 166
 
@@ -173,8 +173,8 @@ void shutdown_executor(TSRMLS_D)
173 173
 		zend_ptr_stack_destroy(&EG(argument_stack));
174 174
 
175 175
 		/* Destroy all op arrays */
176  
-		zend_hash_apply(EG(function_table), (apply_func_t) is_not_internal_function);
177  
-		zend_hash_apply(EG(class_table), (apply_func_t) is_not_internal_class);
  176
+		zend_hash_apply(EG(function_table), (apply_func_t) is_not_internal_function TSRMLS_CC);
  177
+		zend_hash_apply(EG(class_table), (apply_func_t) is_not_internal_class TSRMLS_CC);
178 178
 	} zend_end_try();
179 179
 
180 180
 	zend_destroy_rsrc_list(TSRMLS_C); /* must be destroyed after the main symbol table and
@@ -271,12 +271,11 @@ ZEND_API int zend_is_true(zval *op)
271 271
 }
272 272
 
273 273
 
274  
-ZEND_API int zval_update_constant(zval **pp, void *arg)
  274
+ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
275 275
 {
276 276
 	zval *p = *pp;
277 277
 	zend_bool inline_change = (zend_bool) (unsigned long) arg;
278 278
 	zval const_value;
279  
-	TSRMLS_FETCH();
280 279
 
281 280
 	if (p->type == IS_CONSTANT) {
282 281
 		int refcount;
@@ -340,7 +339,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
340 339
 			}
341 340
 			zend_hash_del(p->value.ht, str_index, str_index_len);
342 341
 		}
343  
-		zend_hash_apply_with_argument(p->value.ht, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
  342
+		zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
344 343
 	}
345 344
 	return 0;
346 345
 }
12  Zend/zend_extensions.c
@@ -114,7 +114,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
114 114
 }
115 115
 
116 116
 
117  
-static void zend_extension_shutdown(zend_extension *extension)
  117
+static void zend_extension_shutdown(zend_extension *extension TSRMLS_DC)
118 118
 {
119 119
 #if ZEND_EXTENSIONS_SUPPORT
120 120
 	if (extension->shutdown) {
@@ -153,9 +153,9 @@ int zend_startup_extensions()
153 153
 }
154 154
 
155 155
 
156  
-void zend_shutdown_extensions()
  156
+void zend_shutdown_extensions(TSRMLS_D)
157 157
 {
158  
-	zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_shutdown);
  158
+	zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_shutdown TSRMLS_CC);
159 159
 	zend_llist_destroy(&zend_extensions);
160 160
 }
161 161
 
@@ -170,7 +170,7 @@ void zend_extension_dtor(zend_extension *extension)
170 170
 }
171 171
 
172 172
 
173  
-static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args)
  173
+static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args TSRMLS_DC)
174 174
 {
175 175
 	int message;
176 176
 	void *arg;
@@ -186,7 +186,9 @@ static void zend_extension_message_dispatcher(zend_extension *extension, int num
186 186
 
187 187
 ZEND_API void zend_extension_dispatch_message(int message, void *arg)
188 188
 {
189  
-	zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher, 2, message, arg);
  189
+	TSRMLS_FETCH();
  190
+
  191
+	zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
190 192
 }
191 193
 
192 194
 
2  Zend/zend_extensions.h
@@ -110,7 +110,7 @@ ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE ha
110 110
 void zend_append_version_info(zend_extension *extension);
111 111
 int zend_startup_extensions_mechanism(void);
112 112
 int zend_startup_extensions(void);
113  
-void zend_shutdown_extensions(void);
  113
+void zend_shutdown_extensions(TSRMLS_D);
114 114
 ZEND_API zend_extension *zend_get_extension(char *extension_name);
115 115
 
116 116
 #endif /* ZEND_EXTENSIONS_H */
6  Zend/zend_hash.c
@@ -683,7 +683,7 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
683 683
  */
684 684
 
685 685
 
686  
-ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
  686
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
687 687
 {
688 688
 	Bucket *p;
689 689
 
@@ -692,7 +692,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
692 692
 	HASH_PROTECT_RECURSION(ht);
693 693
 	p = ht->pListHead;
694 694
 	while (p != NULL) {
695  
-		if (apply_func(p->pData)) {
  695
+		if (apply_func(p->pData TSRMLS_CC)) {
696 696
 			p = zend_hash_apply_deleter(ht, p);
697 697
 		} else {
698 698
 			p = p->pListNext;
@@ -702,7 +702,7 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func)
702 702
 }
703 703
 
704 704
 
705  
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument)
  705
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *argument TSRMLS_DC)
706 706
 {
707 707
 	Bucket *p;
708 708
 
6  Zend/zend_hash.h
@@ -37,7 +37,7 @@ typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
37 37
 typedef int  (*compare_func_t)(const void *, const void *);
38 38
 typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t);
39 39
 typedef void (*dtor_func_t)(void *pDest);
40  
-typedef int (*apply_func_t)(void *pDest);
  40
+typedef int (*apply_func_t)(void *pDest TSRMLS_DC);
41 41
 typedef int (*apply_func_arg_t)(void *pDest, void *argument);
42 42
 typedef void (*copy_ctor_func_t)(void *pElement);
43 43
 
@@ -116,8 +116,8 @@ typedef struct _zend_hash_key {
116 116
 typedef int (*apply_func_args_t)(void *pDest, int num_args, va_list args, zend_hash_key *hash_key);
117 117
 
118 118
 ZEND_API void zend_hash_graceful_destroy(HashTable *ht);
119  
-ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func);
120  
-ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *);
  119
+ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
  120
+ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC);
121 121
 ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...);
122 122
 
123 123
 
20  Zend/zend_ini.c
@@ -31,7 +31,7 @@ static HashTable *registered_zend_ini_directives;
31 31
 /*
32 32
  * hash_apply functions
33 33
  */
34  
-static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number)
  34
+static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number TSRMLS_DC)
35 35
 {
36 36
 	if (ini_entry->module_number == *module_number) {
37 37
 		return 1;
@@ -41,10 +41,8 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
41 41
 }
42 42
 
43 43
 
44  
-static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage)
  44
+static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS_DC)
45 45
 {
46  
-	TSRMLS_FETCH();
47  
-
48 46
 	if (ini_entry->modified) {
49 47
 		if (ini_entry->on_modify) {
50 48
 			ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
@@ -81,7 +79,7 @@ ZEND_API int zend_ini_shutdown(TSRMLS_D)
81 79
 
82 80
 ZEND_API int zend_ini_deactivate(TSRMLS_D)
83 81
 {
84  
-	zend_hash_apply_with_argument(&EG(ini_directives), (int (*)(void *, void *)) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE);
  82
+	zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE TSRMLS_CC);
85 83
 	return SUCCESS;
86 84
 }
87 85
 
@@ -159,14 +157,14 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
159 157
 
160 158
 ZEND_API void zend_unregister_ini_entries(int module_number)
161 159
 {
162  
-	zend_hash_apply_with_argument(registered_zend_ini_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
  160
+	TSRMLS_FETCH();
  161
+
  162
+	zend_hash_apply_with_argument(registered_zend_ini_directives, (apply_func_arg_t) zend_remove_ini_entries, (void *) &module_number TSRMLS_CC);
163 163
 }
164 164
 
165 165
 
166  
-static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
  166
+static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC)
167 167
 {
168  
-	TSRMLS_FETCH();
169  
-
170 168
 	if (p->on_modify) {
171 169
 		p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage TSRMLS_CC);
172 170
 	}
@@ -176,7 +174,7 @@ static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
176 174
 
177 175
 ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC)
178 176
 {
179  
-	zend_hash_apply_with_argument(&EG(ini_directives), (int (*)(void *, void *)) zend_ini_refresh_cache, (void *)(long) stage);
  177
+	zend_hash_apply_with_argument(&EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC);
180 178
 }
181 179
 
182 180
 
@@ -224,7 +222,7 @@ ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage)
224 222
 		return FAILURE;
225 223
 	}
226 224
 
227  
-	zend_restore_ini_entry_cb(ini_entry, stage);
  225
+	zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC);
228 226
 	return SUCCESS;
229 227
 }
230 228
 
14  Zend/zend_list.c
@@ -263,7 +263,7 @@ void zend_destroy_rsrc_plist(TSRMLS_D)
263 263
 }
264 264
 
265 265
 
266  
-static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id)
  266
+static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id TSRMLS_DC)
267 267
 {
268 268
 	if (le->type == *resource_id) {
269 269
 		return 1;
@@ -273,13 +273,11 @@ static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id)
273 273
 }
274 274
 
275 275
 
276  
-static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number)
  276
+static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number TSRMLS_DC)
277 277
 {
278 278
 	if (ld->module_number == *module_number) {
279  
-		TSRMLS_FETCH();
280  
-
281  
-		zend_hash_apply_with_argument(&EG(regular_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
282  
-		zend_hash_apply_with_argument(&EG(persistent_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
  279
+		zend_hash_apply_with_argument(&EG(regular_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
  280
+		zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
283 281
 		return 1;
284 282
 	} else {
285 283
 		return 0;
@@ -287,9 +285,9 @@ static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *
287 285
 }
288 286
 
289 287
 
290  
-void zend_clean_module_rsrc_dtors(int module_number)
  288
+void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC)
291 289
 {
292  
-	zend_hash_apply_with_argument(&list_destructors, (int (*)(void *,void *)) zend_clean_module_rsrc_dtors_cb, (void *) &module_number);
  290
+	zend_hash_apply_with_argument(&list_destructors, (apply_func_arg_t) zend_clean_module_rsrc_dtors_cb, (void *) &module_number TSRMLS_CC);
293 291
 }
294 292
 
295 293
 
2  Zend/zend_list.h
@@ -65,7 +65,7 @@ enum list_entry_type {
65 65
 void list_entry_destructor(void *ptr);
66 66
 void plist_entry_destructor(void *ptr);
67 67
 
68  
-void zend_clean_module_rsrc_dtors(int module_number);
  68
+void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC);
69 69
 int zend_init_rsrc_list(TSRMLS_D);
70 70
 int zend_init_rsrc_plist(TSRMLS_D);
71 71
 void zend_destroy_rsrc_list(TSRMLS_D);
12  Zend/zend_llist.c
@@ -158,12 +158,12 @@ ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data))
158 158
 }
159 159
 
160 160
 
161  
-ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data))
  161
+ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC)
162 162
 {
163 163
 	zend_llist_element *element;
164 164
 
165 165
 	for (element=l->head; element; element=element->next) {
166  
-		func(element->data);
  166
+		func(element->data TSRMLS_CC);
167 167
 	}
168 168
 }
169 169
 
@@ -205,24 +205,24 @@ ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func)
205 205
 }
206 206
 
207 207
 
208  
-ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *data, void *arg), void *arg)
  208
+ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC)
209 209
 {
210 210
 	zend_llist_element *element;
211 211
 
212 212
 	for (element=l->head; element; element=element->next) {
213  
-		func(element->data, arg);
  213
+		func(element->data, arg TSRMLS_CC);
214 214
 	}
215 215
 }
216 216
 
217 217
 
218  
-ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...)
  218
+ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...)
219 219
 {
220 220
 	zend_llist_element *element;
221 221
 	va_list args;
222 222
 
223 223
 	va_start(args, num_args);
224 224
 	for (element=l->head; element; element=element->next) {
225  
-		func(element->data, num_args, args);
  225
+		func(element->data, num_args, args TSRMLS_CC);
226 226
 	}
227 227
 	va_end(args);
228 228
 }
12  Zend/zend_llist.h
@@ -31,9 +31,9 @@ typedef struct _zend_llist_element {
31 31
 
32 32
 typedef void (*llist_dtor_func_t)(void *);
33 33
 typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
34  
-typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg);
35  
-typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
36  
-typedef void (*llist_apply_func_t)(void *);
  34
+typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args TSRMLS_DC);
  35
+typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg TSRMLS_DC);
  36
+typedef void (*llist_apply_func_t)(void * TSRMLS_DC);
37 37
 
38 38
 typedef struct _zend_llist {
39 39
 	zend_llist_element *head;
@@ -55,10 +55,10 @@ ZEND_API void zend_llist_destroy(zend_llist *l);
55 55
 ZEND_API void zend_llist_clean(zend_llist *l);
56 56
 ZEND_API void zend_llist_remove_tail(zend_llist *l);
57 57
 ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
58  
-ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t);
  58
+ZEND_API void zend_llist_apply(zend_llist *l, llist_apply_func_t func TSRMLS_DC);
59 59
 ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
60  
-ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t, void *arg);
61  
-ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
  60
+ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t func, void *arg TSRMLS_DC);
  61
+ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func TSRMLS_DC, int num_args, ...);
62 62
 ZEND_API int zend_llist_count(zend_llist *l);
63 63
 ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func);
64 64
 
4  Zend/zend_modules.h
@@ -77,8 +77,8 @@ struct _zend_module_entry {
77 77
 extern ZEND_API HashTable module_registry;
78 78
 
79 79
 void module_destructor(zend_module_entry *module);
80  
-int module_registry_cleanup(zend_module_entry *module);
81  
-int module_registry_request_startup(zend_module_entry *module);
  80
+int module_registry_cleanup(zend_module_entry *module TSRMLS_DC);
  81
+int module_registry_request_startup(zend_module_entry *module TSRMLS_DC);
82 82
 
83 83
 #define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
84 84
 #endif
20  Zend/zend_opcode.c
@@ -27,7 +27,7 @@
27 27
 #include "zend_API.h"
28 28
 
29 29
 
30  
-static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array)
  30
+static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
31 31
 {
32 32
 	if (extension->op_array_ctor) {
33 33
 		extension->op_array_ctor(op_array);
@@ -35,7 +35,7 @@ static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend
35 35
 }
36 36
 
37 37
 
38  
-static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array)
  38
+static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
39 39
 {
40 40
 	if (extension->op_array_dtor) {
41 41
 		extension->op_array_dtor(op_array);
@@ -89,7 +89,7 @@ void init_op_array(zend_op_array *op_array, int type, int initial_ops_size TSRML
89 89
 
90 90
 	op_array->start_op = NULL;
91 91
 
92  
-	zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_ctor_handler, op_array);
  92
+	zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_ctor_handler, op_array TSRMLS_CC);
93 93
 }
94 94
 
95 95
 
@@ -138,6 +138,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
138 138
 {
139 139
 	zend_op *opline = op_array->opcodes;
140 140
 	zend_op *end = op_array->opcodes+op_array->last;
  141
+	TSRMLS_FETCH();
141 142
 
142 143
 	if (op_array->static_variables) {
143 144
 		zend_hash_destroy(op_array->static_variables);
@@ -176,7 +177,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
176 177
 		efree(op_array->brk_cont_array);
177 178
 	}
178 179
 	if (op_array->done_pass_two) {
179  
-		zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
  180
+		zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_dtor_handler, op_array TSRMLS_CC);
180 181
 	}
181 182
 }
182 183
 
@@ -256,7 +257,7 @@ static void zend_update_extended_info(zend_op_array *op_array TSRMLS_DC)
256 257
 
257 258
 
258 259
 
259  
-static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array)
  260
+static void zend_extension_op_array_handler(zend_extension *extension, zend_op_array *op_array TSRMLS_DC)
260 261
 {
261 262
 	if (extension->op_array_handler) {
262 263
 		extension->op_array_handler(op_array);
@@ -264,10 +265,9 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
264 265
 }
265 266
 
266 267
 
267  
-int pass_two(zend_op_array *op_array)
  268
+int pass_two(zend_op_array *op_array TSRMLS_DC)
268 269
 {
269 270
 	zend_op *opline, *end;
270  
-	TSRMLS_FETCH();
271 271
 
272 272
 	if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) {
273 273
 		return 0;
@@ -276,7 +276,7 @@ int pass_two(zend_op_array *op_array)
276 276
 		zend_update_extended_info(op_array TSRMLS_CC);
277 277
 	}
278 278
 	if (CG(handle_op_arrays)) {
279  
-		zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
  279
+		zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) zend_extension_op_array_handler, op_array TSRMLS_CC);
280 280
 	}
281 281
 
282 282
 	opline = op_array->opcodes;
@@ -299,10 +299,10 @@ int pass_two(zend_op_array *op_array)
299 299
 }
300 300
 
301 301
 
302  
-int print_class(zend_class_entry *class_entry)
  302
+int print_class(zend_class_entry *class_entry TSRMLS_DC)
303 303
 {
304 304
 	printf("Class %s:\n", class_entry->name);
305  
-	zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two);
  305
+	zend_hash_apply(&class_entry->function_table, (apply_func_t) pass_two TSRMLS_CC);
306 306
 	printf("End of class %s.\n\n", class_entry->name);
307 307
 	return 0;
308 308
 }
1  ext/crack/crack.c
@@ -65,7 +65,6 @@ long _crack_open_dict(char *dictpath TSRMLS_DC)
65 65
 {
66 66
 	PWDICT *pwdict;
67 67
 	long resource;
68  
-	TSRMLS_FETCH();
69 68
 
70 69
 	if (CRACKG(current_id) != -1) {
71 70
 		zend_error(E_WARNING, "Can not use more than one open dictionary with this implementation of libcrack");
122  ext/domxml/php_domxml.c
@@ -466,12 +466,11 @@ static zval *php_xpathobject_new(xmlXPathObjectPtr obj, int *found) {
466 466
 	return(wrapper);
467 467
 }
468 468
 
469  
-void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2)
  469
+void *php_xpath_get_context(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
470 470
 {
471 471
 	void *obj;
472 472
 	zval **handle;
473 473
 	int type;
474  
-	TSRMLS_FETCH();
475 474
 					  
476 475
 	if (Z_TYPE_P(wrapper) != IS_OBJECT) {
477 476
 		php_error(E_ERROR, "Wrapper is not an object");
@@ -546,12 +545,11 @@ static zval *php_xpathcontext_new(xmlXPathContextPtr obj, int *found) {
546 545
 	return(wrapper);
547 546
 }
548 547
 
549  
-void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2)
  548
+void *php_dom_get_object(zval *wrapper, int rsrc_type1, int rsrc_type2 TSRMLS_DC)
550 549
 {
551 550
 	void *obj;
552 551
 	zval **handle;
553 552
 	int type;
554  
-	TSRMLS_FETCH();
555 553
 				  
556 554
 	if (Z_TYPE_P(wrapper) != IS_OBJECT) {
557 555
 		php_error(E_ERROR, "Wrapper is not an object");
@@ -878,7 +876,7 @@ PHP_FUNCTION(domxml_attr_name)
878 876
 	xmlAttrPtr attrp;
879 877
 	
880 878
 	id = getThis();
881  
-	attrp = php_dom_get_object(id, le_domxmlattrp, 0);
  879
+	attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
882 880
 		
883 881
 	RETURN_STRING((char *) (attrp->name), 1);
884 882
 }
@@ -892,7 +890,7 @@ PHP_FUNCTION(domxml_attr_value)
892 890
 	xmlAttrPtr attrp;
893 891
 	
894 892
 	id = getThis();
895  
-	attrp = php_dom_get_object(id, le_domxmlattrp, 0);
  893
+	attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
896 894
 		
897 895
 	RETURN_STRING((char *) xmlNodeGetContent((xmlNodePtr) attrp), 1);
898 896
 }
@@ -906,7 +904,7 @@ PHP_FUNCTION(domxml_attr_specified)
906 904
 	xmlAttrPtr attrp;
907 905
 	
908 906
 	id = getThis();
909  
-	attrp = php_dom_get_object(id, le_domxmlattrp, 0);
  907
+	attrp = php_dom_get_object(id, le_domxmlattrp, 0 TSRMLS_CC);
910 908
 		
911 909
 	RETURN_TRUE;
912 910
 }
@@ -923,7 +921,7 @@ PHP_FUNCTION(domxml_pi_target)
923 921
 	xmlNodePtr nodep;
924 922
 	
925 923
 	id = getThis();
926  
-	nodep = php_dom_get_object(id, le_domxmlpip, 0);
  924
+	nodep = php_dom_get_object(id, le_domxmlpip, 0 TSRMLS_CC);
927 925
 
928 926
 	RETURN_STRING((char *)nodep->name, 1);
929 927
 }
@@ -937,7 +935,7 @@ PHP_FUNCTION(domxml_pi_data)
937 935
 	xmlNodePtr nodep;
938 936
 	
939 937
 	id = getThis();
940  
-	nodep = php_dom_get_object(id, le_domxmlpip, 0);
  938
+	nodep = php_dom_get_object(id, le_domxmlpip, 0 TSRMLS_CC);
941 939
 
942 940
 	RETURN_STRING(xmlNodeGetContent(nodep), 1);
943 941
 }
@@ -954,7 +952,7 @@ PHP_FUNCTION(domxml_cdata_length)
954 952
 	xmlNodePtr nodep;
955 953
 	
956 954
 	id = getThis();
957  
-	nodep = php_dom_get_object(id, le_domxmlcdatap, 0);
  955
+	nodep = php_dom_get_object(id, le_domxmlcdatap, 0 TSRMLS_CC);
958 956
 		
959 957
 	RETURN_LONG(1);
960 958
 }
@@ -999,7 +997,7 @@ PHP_FUNCTION(domxml_node_name)
999 997
 	const char *str = NULL;
1000 998
 	
1001 999
 	id = getThis();
1002  
-	n = php_dom_get_object(id, le_domxmlnodep, 0);
  1000
+	n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1003 1001
 
1004 1002
   switch (n->type)
1005 1003
     {
@@ -1044,7 +1042,7 @@ PHP_FUNCTION(domxml_node_value)
1044 1042
 	char *str = NULL;
1045 1043
 	
1046 1044
 	id = getThis();
1047  
-	n = php_dom_get_object(id, le_domxmlnodep, 0);
  1045
+	n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1048 1046
 
1049 1047
 	if (!n) {
1050 1048
 		RETURN_FALSE;
@@ -1071,7 +1069,7 @@ PHP_FUNCTION(domxml_node_type)
1071 1069
 	xmlNode *n;
1072 1070
 	
1073 1071
 	id = getThis();
1074  
-	n = php_dom_get_object(id, le_domxmlnodep, 0);
  1072
+	n = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1075 1073
 
1076 1074
 	if (!n) {
1077 1075
 		RETURN_FALSE;
@@ -1089,7 +1087,7 @@ PHP_FUNCTION(domxml_node_first_child)
1089 1087
 	int ret;
1090 1088
 	
1091 1089
 	id = getThis();
1092  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1090
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1093 1091
 
1094 1092
 	first = nodep->children;
1095 1093
 	if (!first) {
@@ -1112,7 +1110,7 @@ PHP_FUNCTION(domxml_node_last_child)
1112 1110
 	int ret;
1113 1111
 	
1114 1112
 	id = getThis();
1115  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1113
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1116 1114
 
1117 1115
 	last = nodep->last;
1118 1116
 	if (!last) {
@@ -1135,7 +1133,7 @@ PHP_FUNCTION(domxml_node_next_sibling)
1135 1133
 	int ret;
1136 1134
 	
1137 1135
 	id = getThis();
1138  
-	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
  1136
+	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
1139 1137
 		RETURN_FALSE;
1140 1138
 
1141 1139
 	first = nodep->next;
@@ -1159,7 +1157,7 @@ PHP_FUNCTION(domxml_node_previous_sibling)
1159 1157
 	int ret;
1160 1158
 	
1161 1159
 	id = getThis();
1162  
-	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
  1160
+	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
1163 1161
 		RETURN_FALSE;
1164 1162
 
1165 1163
 	first = nodep->prev;
@@ -1184,7 +1182,7 @@ PHP_FUNCTION(domxml_node_owner_document)
1184 1182
 	int ret;
1185 1183
 	
1186 1184
 	id = getThis();
1187  
-	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
  1185
+	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
1188 1186
 		RETURN_FALSE;
1189 1187
 
1190 1188
 	docp = nodep->doc;
@@ -1207,7 +1205,7 @@ PHP_FUNCTION(domxml_node_has_child_nodes)
1207 1205
 	xmlNode *nodep;
1208 1206
 	
1209 1207
 	id = getThis();
1210  
-	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
  1208
+	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
1211 1209
 		RETURN_FALSE;
1212 1210
 
1213 1211
 	if (nodep->children) {
@@ -1226,7 +1224,7 @@ PHP_FUNCTION(domxml_node_has_attributes)
1226 1224
 	xmlNode *nodep;
1227 1225
 	
1228 1226
 	id = getThis();
1229  
-	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
  1227
+	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
1230 1228
 		RETURN_FALSE;
1231 1229
 
1232 1230
 	if(nodep->type != XML_ELEMENT_NODE)
@@ -1249,7 +1247,7 @@ PHP_FUNCTION(domxml_node_prefix)
1249 1247
  	xmlNsPtr	ns;
1250 1248
 	
1251 1249
 	id = getThis();
1252  
-	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0)))
  1250
+	if(NULL == (nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC)))
1253 1251
 		RETURN_FALSE;
1254 1252
 
1255 1253
 	ns = nodep->ns;
@@ -1274,7 +1272,7 @@ PHP_FUNCTION(domxml_node_parent)
1274 1272
 	int ret;
1275 1273
 	
1276 1274
 	id = getThis();
1277  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1275
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1278 1276
 
1279 1277
 	last = nodep->parent;
1280 1278
 	if (!last) {
@@ -1296,7 +1294,7 @@ PHP_FUNCTION(domxml_node_children)
1296 1294
 	int ret;
1297 1295
 	
1298 1296
 	id = getThis();
1299  
-	nodep = php_dom_get_object(id, le_domxmlnodep, le_domxmldocp);
  1297
+	nodep = php_dom_get_object(id, le_domxmlnodep, le_domxmldocp TSRMLS_CC);
1300 1298
 
1301 1299
 	/* Even if the nodep is a XML_DOCUMENT_NODE the type is at the
1302 1300
 	   same position.
@@ -1330,7 +1328,7 @@ PHP_FUNCTION(domxml_node_unlink_node)
1330 1328
 	xmlNode *nodep;
1331 1329
 	
1332 1330
 	id = getThis();
1333  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1331
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1334 1332
 
1335 1333
 	xmlUnlinkNode(nodep);
1336 1334
 	xmlFreeNode(nodep);
@@ -1351,8 +1349,8 @@ PHP_FUNCTION(domxml_node_add_child)
1351 1349
 		WRONG_PARAM_COUNT;
1352 1350
 	}
1353 1351
 	id = getThis();
1354  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
1355  
-	child = php_dom_get_object(node, le_domxmlnodep, 0);
  1352
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
  1353
+	child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC);
1356 1354
 
1357 1355
 	if (!child || !nodep) {
1358 1356
 		RETURN_FALSE;
@@ -1378,8 +1376,8 @@ PHP_FUNCTION(domxml_node_append_child)
1378 1376
 		WRONG_PARAM_COUNT;
1379 1377
 	}
1380 1378
 	id = getThis();
1381  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
1382  
-	child = php_dom_get_object(node, le_domxmlnodep, 0);
  1379
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
  1380
+	child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC);
1383 1381
 
1384 1382
 	if (!child || !nodep) {
1385 1383
 		RETURN_FALSE;
@@ -1405,9 +1403,9 @@ PHP_FUNCTION(domxml_node_insert_before)
1405 1403
 		WRONG_PARAM_COUNT;
1406 1404
 	}
1407 1405
 	id = getThis();
1408  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
1409  
-	child = php_dom_get_object(node, le_domxmlnodep, 0);
1410  
-	refp = php_dom_get_object(ref, le_domxmlnodep, 0);
  1406
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
  1407
+	child = php_dom_get_object(node, le_domxmlnodep, 0 TSRMLS_CC);
  1408
+	refp = php_dom_get_object(ref, le_domxmlnodep, 0 TSRMLS_CC);
1411 1409
 
1412 1410
 	if (!child || !nodep || !refp) {
1413 1411
 		RETURN_FALSE;
@@ -1433,7 +1431,7 @@ PHP_FUNCTION(domxml_node_set_name)
1433 1431
 	}
1434 1432
 
1435 1433
 	id = getThis();
1436  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1434
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1437 1435
 	convert_to_string(name);
1438 1436
 
1439 1437
 	if(name->value.str.len)
@@ -1454,7 +1452,7 @@ PHP_FUNCTION(domxml_node_attributes)
1454 1452
 #endif
1455 1453
 	
1456 1454
 	id = getThis();
1457  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1455
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1458 1456
 
1459 1457
 	if(node_attributes(&attrs, nodep) < 0)
1460 1458
 		RETURN_FALSE;
@@ -1492,7 +1490,7 @@ PHP_FUNCTION(domxml_node_new_child)
1492 1490
 		WRONG_PARAM_COUNT;
1493 1491
 	}
1494 1492
 	id = getThis();
1495  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1493
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1496 1494
 
1497 1495
 	convert_to_string(name);
1498 1496
 	convert_to_string(content);
@@ -1523,7 +1521,7 @@ PHP_FUNCTION(domxml_node_set_content)
1523 1521
 	}
1524 1522
 
1525 1523
 	id = getThis();
1526  
-	nodep = php_dom_get_object(id, le_domxmlnodep, 0);
  1524
+	nodep = php_dom_get_object(id, le_domxmlnodep, 0 TSRMLS_CC);
1527 1525
 	convert_to_string(content);
1528 1526
 
1529 1527
 	if(content->value.str.len)
@@ -1548,7 +1546,7 @@ PHP_FUNCTION(domxml_notation_public_id)
1548 1546
 	xmlNotationPtr nodep;
1549 1547
 	
1550 1548
 	id = getThis();
1551  
-	nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0);
  1549
+	nodep = (xmlNotationPtr) php_dom_get_object(id, le_domxmlnotationp, 0 TSRMLS_CC);