@@ -1300,39 +1300,24 @@ static zend_always_inline zend_function *get_static_method_fallback(
1300
1300
1301
1301
ZEND_API zend_function * zend_std_get_static_method (zend_class_entry * ce , zend_string * function_name , const zval * key ) /* {{{ */
1302
1302
{
1303
- zend_function * fbc = NULL ;
1304
1303
zend_string * lc_function_name ;
1305
- zend_class_entry * scope ;
1306
-
1307
1304
if (EXPECTED (key != NULL )) {
1308
1305
lc_function_name = Z_STR_P (key );
1309
1306
} else {
1310
1307
lc_function_name = zend_string_tolower (function_name );
1311
1308
}
1312
1309
1313
- do {
1314
- zval * func = zend_hash_find (& ce -> function_table , lc_function_name );
1315
- if (EXPECTED (func != NULL )) {
1316
- fbc = Z_FUNC_P (func );
1317
- } else if (ce -> constructor
1318
- && ZSTR_LEN (lc_function_name ) == ZSTR_LEN (ce -> name )
1319
- && zend_binary_strncasecmp (ZSTR_VAL (lc_function_name ), ZSTR_LEN (lc_function_name ), ZSTR_VAL (ce -> name ), ZSTR_LEN (lc_function_name ), ZSTR_LEN (lc_function_name )) == 0
1320
- /* Only change the method to the constructor if the constructor isn't called __construct
1321
- * we check for __ so we can be binary safe for lowering, we should use ZEND_CONSTRUCTOR_FUNC_NAME
1322
- */
1323
- && (ZSTR_VAL (ce -> constructor -> common .function_name )[0 ] != '_'
1324
- || ZSTR_VAL (ce -> constructor -> common .function_name )[1 ] != '_' )) {
1325
- fbc = ce -> constructor ;
1326
- } else {
1327
- if (UNEXPECTED (!key )) {
1328
- zend_string_release_ex (lc_function_name , 0 );
1329
- }
1330
- return get_static_method_fallback (ce , function_name );
1310
+ zval * func = zend_hash_find (& ce -> function_table , lc_function_name );
1311
+ if (UNEXPECTED (!func )) {
1312
+ if (UNEXPECTED (!key )) {
1313
+ zend_string_release_ex (lc_function_name , 0 );
1331
1314
}
1332
- } while (0 );
1315
+ return get_static_method_fallback (ce , function_name );
1316
+ }
1333
1317
1318
+ zend_function * fbc = Z_FUNC_P (func );
1334
1319
if (!(fbc -> op_array .fn_flags & ZEND_ACC_PUBLIC )) {
1335
- scope = zend_get_executed_scope ();
1320
+ zend_class_entry * scope = zend_get_executed_scope ();
1336
1321
if (UNEXPECTED (fbc -> common .scope != scope )) {
1337
1322
if (UNEXPECTED (fbc -> op_array .fn_flags & ZEND_ACC_PRIVATE )
1338
1323
|| UNEXPECTED (!zend_check_protected (zend_get_function_root_class (fbc ), scope ))) {
0 commit comments