@@ -186,19 +186,17 @@ zval *xmlreader_write_property(zend_object *object, zend_string *name, zval *val
186
186
/* {{{ */
187
187
static zend_function * xmlreader_get_method (zend_object * * obj , zend_string * name , const zval * key )
188
188
{
189
- if (ZSTR_LEN (name ) == sizeof ("open" ) - 1
190
- && (ZSTR_VAL (name )[0 ] == 'o' || ZSTR_VAL (name )[0 ] == 'O' )
191
- && (ZSTR_VAL (name )[1 ] == 'p' || ZSTR_VAL (name )[1 ] == 'P' )
192
- && (ZSTR_VAL (name )[2 ] == 'e' || ZSTR_VAL (name )[2 ] == 'E' )
193
- && (ZSTR_VAL (name )[3 ] == 'n' || ZSTR_VAL (name )[3 ] == 'N' )) {
194
- return (zend_function * )& xmlreader_open_fn ;
195
- } else if (ZSTR_LEN (name ) == sizeof ("xml" ) - 1
196
- && (ZSTR_VAL (name )[0 ] == 'x' || ZSTR_VAL (name )[0 ] == 'X' )
197
- && (ZSTR_VAL (name )[1 ] == 'm' || ZSTR_VAL (name )[1 ] == 'M' )
198
- && (ZSTR_VAL (name )[2 ] == 'l' || ZSTR_VAL (name )[2 ] == 'L' )) {
199
- return (zend_function * )& xmlreader_xml_fn ;
200
- }
201
- return zend_std_get_method (obj , name , key );;
189
+ zend_function * method = zend_std_get_method (obj , name , key );
190
+ if (method && (method -> common .fn_flags & ZEND_ACC_STATIC ) && method -> common .type == ZEND_INTERNAL_FUNCTION ) {
191
+ /* There are only two static internal methods and they both have overrides. */
192
+ if (ZSTR_LEN (name ) == sizeof ("xml" ) - 1 ) {
193
+ return (zend_function * ) & xmlreader_xml_fn ;
194
+ } else {
195
+ ZEND_ASSERT (ZSTR_LEN (name ) == sizeof ("open" ) - 1 );
196
+ return (zend_function * ) & xmlreader_open_fn ;
197
+ }
198
+ }
199
+ return method ;
202
200
}
203
201
/* }}} */
204
202
0 commit comments