@@ -168,22 +168,25 @@ static zend_function *zend_test_class_method_get(zend_object **object, zend_stri
168
168
/* }}} */
169
169
170
170
static zend_function * zend_test_class_static_method_get (zend_class_entry * ce , zend_string * name ) /* {{{ */ {
171
- zend_internal_function * fptr ;
172
-
173
- if (EXPECTED (EG (trampoline ).common .function_name == NULL )) {
174
- fptr = (zend_internal_function * ) & EG (trampoline );
175
- } else {
176
- fptr = emalloc (sizeof (zend_internal_function ));
171
+ if (zend_string_equals_literal_ci (name , "test" )) {
172
+ zend_internal_function * fptr ;
173
+
174
+ if (EXPECTED (EG (trampoline ).common .function_name == NULL )) {
175
+ fptr = (zend_internal_function * ) & EG (trampoline );
176
+ } else {
177
+ fptr = emalloc (sizeof (zend_internal_function ));
178
+ }
179
+ memset (fptr , 0 , sizeof (zend_internal_function ));
180
+ fptr -> type = ZEND_INTERNAL_FUNCTION ;
181
+ fptr -> num_args = 1 ;
182
+ fptr -> scope = ce ;
183
+ fptr -> fn_flags = ZEND_ACC_CALL_VIA_HANDLER |ZEND_ACC_STATIC ;
184
+ fptr -> function_name = zend_string_copy (name );
185
+ fptr -> handler = ZEND_FN (zend_test_func );
186
+
187
+ return (zend_function * )fptr ;
177
188
}
178
- memset (fptr , 0 , sizeof (zend_internal_function ));
179
- fptr -> type = ZEND_INTERNAL_FUNCTION ;
180
- fptr -> num_args = 1 ;
181
- fptr -> scope = ce ;
182
- fptr -> fn_flags = ZEND_ACC_CALL_VIA_HANDLER |ZEND_ACC_STATIC ;
183
- fptr -> function_name = zend_string_copy (name );
184
- fptr -> handler = ZEND_FN (zend_test_func );
185
-
186
- return (zend_function * )fptr ;
189
+ return zend_std_get_static_method (ce , name , NULL );
187
190
}
188
191
/* }}} */
189
192
@@ -192,12 +195,19 @@ static ZEND_METHOD(_ZendTestClass, __toString) /* {{{ */ {
192
195
}
193
196
/* }}} */
194
197
198
+ /* Internal function returns bool, we return int. */
199
+ static ZEND_METHOD (_ZendTestClass , is_object ) /* {{{ */ {
200
+ RETURN_LONG (42 );
201
+ }
202
+ /* }}} */
203
+
195
204
static ZEND_METHOD (_ZendTestTrait , testMethod ) /* {{{ */ {
196
205
RETURN_TRUE ;
197
206
}
198
207
/* }}} */
199
208
200
209
static const zend_function_entry zend_test_class_methods [] = {
210
+ ZEND_ME (_ZendTestClass , is_object , NULL , ZEND_ACC_PUBLIC |ZEND_ACC_STATIC )
201
211
ZEND_ME (_ZendTestClass , __toString , NULL , ZEND_ACC_DEPRECATED )
202
212
ZEND_FE_END
203
213
};
0 commit comments