[PHP-DEV] Bug #11226 Updated: Unable to reference functions inside a class via Variable Funcitons

2001-06-18 Thread kalowsky

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=11226edit=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]




[PHP-DEV] Bug #11226 Updated: Unable to reference functions inside a class via Variable Funcitons

2001-06-18 Thread mikehatesspam

ID: 11226
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Scripting Engine problem
Operating system: Linux 2.4.2 (Redhat Linux 7.1)
PHP Version: 4.0.4pl1
Description: Unable to reference functions inside a class via Variable Funcitons

I modified the code like this:

?

function xyz() {

echo This always works;
}

class test {

function testfunc() {

echo This now works;
}

function calltest() {

$function_name = 'test::testfunc';

$function_name();

}
}

$t = new test;
$t-calltest();

?

I got the exact same error.  I just don't think it can find functions inside a class.

Previous Comments:
---

[2001-06-18 10:16:18] [EMAIL PROTECTED]
i do believe you need to declare the function testfunc() BEFORE you try to reference 
it.  try that and see if it works.

---

[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();

?


---


Full Bug description available at: http://bugs.php.net/?id=11226


-- 
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]