@@ -2147,7 +2147,6 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
2147
2147
int count = 0 , unload = 0 ;
2148
2148
HashTable * target_function_table = function_table ;
2149
2149
int error_type ;
2150
- zend_function * ctor = NULL , * dtor = NULL , * clone = NULL , * __get = NULL , * __set = NULL , * __unset = NULL , * __isset = NULL , * __call = NULL , * __callstatic = NULL , * __tostring = NULL , * __debugInfo = NULL , * __serialize = NULL , * __unserialize = NULL ;
2151
2150
zend_string * lowercase_name ;
2152
2151
size_t fname_len ;
2153
2152
@@ -2299,36 +2298,36 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
2299
2298
if (ZSTR_VAL (lowercase_name )[0 ] != '_' || ZSTR_VAL (lowercase_name )[1 ] != '_' ) {
2300
2299
reg_function = NULL ;
2301
2300
} else if (zend_string_equals_literal (lowercase_name , ZEND_CONSTRUCTOR_FUNC_NAME )) {
2302
- ctor = reg_function ;
2303
- ctor -> common .fn_flags |= ZEND_ACC_CTOR ;
2301
+ scope -> constructor = reg_function ;
2302
+ scope -> constructor -> common .fn_flags |= ZEND_ACC_CTOR ;
2304
2303
} else if (zend_string_equals_literal (lowercase_name , ZEND_DESTRUCTOR_FUNC_NAME )) {
2305
- dtor = reg_function ;
2304
+ scope -> destructor = reg_function ;
2306
2305
} else if (zend_string_equals_literal (lowercase_name , ZEND_CLONE_FUNC_NAME )) {
2307
- clone = reg_function ;
2306
+ scope -> clone = reg_function ;
2308
2307
} else if (zend_string_equals_literal (lowercase_name , ZEND_CALL_FUNC_NAME )) {
2309
- __call = reg_function ;
2308
+ scope -> __call = reg_function ;
2310
2309
} else if (zend_string_equals_literal (lowercase_name , ZEND_CALLSTATIC_FUNC_NAME )) {
2311
- __callstatic = reg_function ;
2310
+ scope -> __callstatic = reg_function ;
2312
2311
} else if (zend_string_equals_literal (lowercase_name , ZEND_TOSTRING_FUNC_NAME )) {
2313
- __tostring = reg_function ;
2312
+ scope -> __tostring = reg_function ;
2314
2313
} else if (zend_string_equals_literal (lowercase_name , ZEND_GET_FUNC_NAME )) {
2315
- __get = reg_function ;
2314
+ scope -> __get = reg_function ;
2316
2315
scope -> ce_flags |= ZEND_ACC_USE_GUARDS ;
2317
2316
} else if (zend_string_equals_literal (lowercase_name , ZEND_SET_FUNC_NAME )) {
2318
- __set = reg_function ;
2317
+ scope -> __set = reg_function ;
2319
2318
scope -> ce_flags |= ZEND_ACC_USE_GUARDS ;
2320
2319
} else if (zend_string_equals_literal (lowercase_name , ZEND_UNSET_FUNC_NAME )) {
2321
- __unset = reg_function ;
2320
+ scope -> __unset = reg_function ;
2322
2321
scope -> ce_flags |= ZEND_ACC_USE_GUARDS ;
2323
2322
} else if (zend_string_equals_literal (lowercase_name , ZEND_ISSET_FUNC_NAME )) {
2324
- __isset = reg_function ;
2323
+ scope -> __isset = reg_function ;
2325
2324
scope -> ce_flags |= ZEND_ACC_USE_GUARDS ;
2326
2325
} else if (zend_string_equals_literal (lowercase_name , ZEND_DEBUGINFO_FUNC_NAME )) {
2327
- __debugInfo = reg_function ;
2326
+ scope -> __debugInfo = reg_function ;
2328
2327
} else if (zend_string_equals_literal (lowercase_name , "__serialize" )) {
2329
- __serialize = reg_function ;
2328
+ scope -> __serialize = reg_function ;
2330
2329
} else if (zend_string_equals_literal (lowercase_name , "__unserialize" )) {
2331
- __unserialize = reg_function ;
2330
+ scope -> __unserialize = reg_function ;
2332
2331
} else {
2333
2332
reg_function = NULL ;
2334
2333
}
@@ -2355,21 +2354,6 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
2355
2354
zend_unregister_functions (functions , count , target_function_table );
2356
2355
return FAILURE ;
2357
2356
}
2358
- if (scope ) {
2359
- scope -> constructor = ctor ;
2360
- scope -> destructor = dtor ;
2361
- scope -> clone = clone ;
2362
- scope -> __call = __call ;
2363
- scope -> __callstatic = __callstatic ;
2364
- scope -> __tostring = __tostring ;
2365
- scope -> __get = __get ;
2366
- scope -> __set = __set ;
2367
- scope -> __unset = __unset ;
2368
- scope -> __isset = __isset ;
2369
- scope -> __debugInfo = __debugInfo ;
2370
- scope -> __serialize = __serialize ;
2371
- scope -> __unserialize = __unserialize ;
2372
- }
2373
2357
return SUCCESS ;
2374
2358
}
2375
2359
/* }}} */
0 commit comments