]> granicus.if.org Git - php/commitdiff
- Allow binary strings as method name in $class::$method(), fixes
authorJohannes Schlüter <johannes@php.net>
Thu, 30 Aug 2007 14:48:39 +0000 (14:48 +0000)
committerJohannes Schlüter <johannes@php.net>
Thu, 30 Aug 2007 14:48:39 +0000 (14:48 +0000)
  tests/lang/044.phpt (Etienne Kneuss)

Zend/zend.h
Zend/zend_execute_API.c
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 08b6b04670e32f0984bdef6c2d5ea3795699fe9f..01daaa17be62921fd6f545d8160fe34be13cf681 100644 (file)
@@ -389,7 +389,7 @@ struct _zend_class_entry {
        zend_object_value (*create_object)(zend_class_entry *class_type TSRMLS_DC);
        zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
        int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type TSRMLS_DC); /* a class implements this interface */
-       union _zend_function *(*get_static_method)(zend_class_entry *ce, zstr method, int method_len TSRMLS_DC);
+       union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_uchar type, zstr method, int method_len TSRMLS_DC);
 
        /* serializer callbacks */
        int (*serialize)(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
index 5c2661fd0e824fed23acc715e111f76f76cac20a..e80e5ba427cee613a8793255214977f8616fb36b 100644 (file)
@@ -889,9 +889,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                        zstr lcname = zend_u_str_case_fold(Z_TYPE_P(fci->function_name), fname, fname_len, 1, &lcname_len);
 
                        if (calling_scope->get_static_method) {
-                               EX(function_state).function = calling_scope->get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC);
+                               EX(function_state).function = calling_scope->get_static_method(calling_scope, Z_TYPE_P(fci->function_name), lcname, lcname_len TSRMLS_CC);
                        } else {
-                               EX(function_state).function = zend_std_get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC);
+                               EX(function_state).function = zend_std_get_static_method(calling_scope, Z_TYPE_P(fci->function_name), lcname, lcname_len TSRMLS_CC);
                        }
                        efree(lcname.v);
 
index 24949c59f758e9b8dfeb57a83a5c01957dbf2e87..4c0ddbf345f6f43706289a6ee2d007d8ac587d19 100644 (file)
@@ -903,11 +903,9 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{
 /* }}} */
 
 
-ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zstr function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */
+ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_uchar type, zstr function_name_strval, int function_name_strlen TSRMLS_DC) /* {{{ */
 {
        zend_function *fbc;
-       /* FIXME: type is default */
-       zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
 
        if (zend_u_hash_find(&ce->function_table, type, function_name_strval, function_name_strlen + 1, (void **) &fbc)==FAILURE) {
                if (ce->__callstatic) {
index 033140b67ed63093c4a6af48e76b50a18baa3bf7..8938c65e537edbbedc338ecb2e948de8a4886eb0 100644 (file)
@@ -140,7 +140,7 @@ struct _zend_object_handlers {
 extern ZEND_API zend_object_handlers std_object_handlers;
 
 BEGIN_EXTERN_C()
-ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zstr function_name_strval, int function_name_strlen TSRMLS_DC);
+ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_uchar type, zstr function_name_strval, int function_name_strlen TSRMLS_DC);
 ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, zend_uchar type, zstr property_name, int property_name_len, zend_bool silent TSRMLS_DC);
 ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_uchar type, zstr property_name, int property_name_len TSRMLS_DC);
 ZEND_API union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC);
index 7462e8def754430fe8bc876c71357e777378b48e..67a7baba300cb0b6fbca60d822363a60da72f3f4 100644 (file)
@@ -1815,10 +1815,11 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
                unsigned int function_name_strlen;
                zend_bool is_const = (OP2_TYPE == IS_CONST);
                zend_free_op free_op2;
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = GET_OP2_ZVAL_PTR(BP_VAR_R);
 
@@ -1826,12 +1827,13 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
index 1fa7ac8cfc1dc71afb25a4e9a78d9aac8dbd9220..bc1619c27aeb0232a27aeb622c72367571a2421e 100644 (file)
@@ -2567,10 +2567,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_CONST == IS_CONST);
 
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = &opline->op2.u.constant;
 
@@ -2578,12 +2579,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -3110,10 +3112,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_TMP_VAR == IS_CONST);
                zend_free_op free_op2;
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
 
@@ -3121,12 +3124,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -3555,10 +3559,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_VAR == IS_CONST);
                zend_free_op free_op2;
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
 
@@ -3566,12 +3571,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -3766,10 +3772,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HA
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_UNUSED == IS_CONST);
 
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = NULL;
 
@@ -3777,12 +3784,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HA
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -4179,10 +4187,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_CV == IS_CONST);
 
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
 
@@ -4190,12 +4199,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -10024,10 +10034,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_CONST == IS_CONST);
 
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = &opline->op2.u.constant;
 
@@ -10035,12 +10046,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDL
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -11714,10 +11726,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_TMP_VAR == IS_CONST);
                zend_free_op free_op2;
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = _get_zval_ptr_tmp(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
 
@@ -11725,12 +11738,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -13382,10 +13396,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_VAR == IS_CONST);
                zend_free_op free_op2;
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = _get_zval_ptr_var(&opline->op2, EX(Ts), &free_op2 TSRMLS_CC);
 
@@ -13393,12 +13408,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -14248,10 +14264,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAND
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_UNUSED == IS_CONST);
 
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = NULL;
 
@@ -14259,12 +14276,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAND
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {
@@ -15566,10 +15584,11 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
                unsigned int function_name_strlen;
                zend_bool is_const = (IS_CV == IS_CONST);
 
-
+               zend_uchar function_name_type;
                if (is_const) {
                        function_name_strval = Z_UNIVAL(opline->op2.u.constant);
                        function_name_strlen = Z_UNILEN(opline->op2.u.constant);
+                       function_name_type   = Z_TYPE(opline->op2.u.constant);
                } else {
                        function_name = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
 
@@ -15577,12 +15596,13 @@ static int ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_
                                zend_error_noreturn(E_ERROR, "Function name must be a string");
                        }
                        function_name_strval = zend_u_str_case_fold(Z_TYPE_P(function_name), Z_UNIVAL_P(function_name), Z_UNILEN_P(function_name), 1, &function_name_strlen);
+                       function_name_type   = Z_TYPE_P(function_name);
                }
 
                if (ce->get_static_method) {
-                       EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = ce->get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                } else {
-                       EX(fbc) = zend_std_get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
+                       EX(fbc) = zend_std_get_static_method(ce, function_name_type, function_name_strval, function_name_strlen TSRMLS_CC);
                }
 
                if (!is_const) {