|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-27 08:08 UTC] akul at otamedia dot com
<?
class test
{
function staticFunction($a)
{
echo "\ntest::staticFunction($a)";
}
}
echo "\nTest page\n";
echo 'function_exists=['.function_exists("test::staticFunction").']';
test::staticFunction(999);
call_user_func_array("test::staticFunction",array(999));
?>
Result:
Test page
function_exists=[]
test::staticFunction(999)
Warning: call_user_func_array() expects first argument, 'test::staticFunction',
to be a valid callback in bug.php on line 17
Must be:
Test page
function_exists=[TRUE]
test::staticFunction(999)
test::staticFunction(999)
(Please, don't write me stupid comments about method_exists()! Just read one more time function name.)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 08:00:02 2025 UTC |
The syntax for calling static class methods is array('classname', 'methodname'); Reclassiyfing as documentation problem.Thanks! But how about function_exists()? function_exists(array("test","staticFunction")) doesn't work.