ID: 11226
Updated by: kalowsky
Reported By: [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]