Bug #11226 Updated: Unable to reference functions inside a class via "Variable Funcitons"
| From: | kalowsky@php.net | Date: | Mon, 18 Jun 2001 14:16:19 +0000 |
| Subject: | Bug #11226 Updated: Unable to reference functions inside a class via "Variable Funcitons" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56751@lists.php.net to get a copy of this message | ||
ID: 11226
Updated by: kalowsky
Reported By: mikehatesspam@bigfoot.com
Old-Status: Open
Status: Feedback
Bug Type: Scripting Engine problem
Operating system:
PHP Version: 4.0.4pl1
Assigned To:
Comments:
i do believe you need to declare the function testfunc() BEFORE you try to reference it. try that
and see if it works.
Previous Comments:
---------------------------------------------------------------------------
[2001-05-31 18:32:36] mikehatesspam@bigfoot.com
When I run this script I get this error message:
Fatal error: Call to undefined function: test::testfunc() in
/var/www/html/database/classes/Authenticator/test.php on line 9
I can execute the function by using test::testfunc();
directly, but not by using "Variable Functions". I can also
change $function_name to be 'xyz' and it then works.
<?
class test {
function calltest() {
$function_name = 'test::testfunc';
$function_name();
}
function testfunc() {
echo "This now worksn";
}
}
function xyz() {
echo "This always worksn";
}
$t = new test;
$t->calltest();
?>
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11226&edit=2