1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
This commit is contained in:
Marcus Boerger
2004-01-05 22:45:11 +00:00
parent f16aed2d7a
commit 18ea05b746
2 changed files with 20 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
--TEST--
#26802 (Can't call static method using a variable)
Bug #26802 (Can't call static method using a variable)
--FILE--
<?php

View File

@@ -2470,8 +2470,25 @@ int zend_init_fcall_by_name_handler(ZEND_OPCODE_HANDLER_ARGS)
lcname = zend_str_tolower_dup(function_name_strval, function_name_strlen);
if (zend_hash_find(EG(function_table), lcname, function_name_strlen+1, (void **) &function)==FAILURE) {
efree(lcname);
zend_error(E_ERROR, "Call to undefined function %s()", function_name_strval);
char *method;
zend_class_entry **pce;
if ((method = strstr(lcname, "::")) != NULL) {
*method = '\0';
method +=2;
if (zend_lookup_class(lcname, strlen(lcname), &pce TSRMLS_CC) == SUCCESS) {
if (zend_hash_find(&(*pce)->function_table, method, strlen(method)+1, (void **) &function) == FAILURE) {
efree(lcname);
zend_error(E_ERROR, "Call to undefined method %s()", function_name_strval);
}
} else {
efree(lcname);
zend_error(E_ERROR, "Call to method of undefined class %s()", function_name_strval);
}
} else {
efree(lcname);
zend_error(E_ERROR, "Call to undefined function %s()", function_name_strval);
}
}
efree(lcname);