#30063 [Opn]: call_user_func callable for instance methods, but not documented
| From: | et@php.net | Date: | Sat, 11 Sep 2004 11:16:46 +0000 |
| Subject: | #30063 [Opn]: call_user_func callable for instance methods, but not documented | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969363986@lists.php.net to get a copy of this message | ||
ID: 30063
Updated by: et@php.net
Reported By: aqsalter at westnet dot com dot au
Status: Open
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
You mean something
http://www.php.net/pseudo-types#language.types.callback
?
Previous Comments:
------------------------------------------------------------------------
[2004-09-11 11:49:42] aidan@php.net
I don't know what is meant by "calling instances", I assume he means
"ability to call a method of a class" - This information should be
present, but not on this page.
I think we need some information about the "callback" type. This
information really isn't specific to call_user_func, either.
I suggest we pop a language.types.callback page in, and link it somehow
from pages that use a callback function.
------------------------------------------------------------------------
[2004-09-11 04:46:18] aqsalter at westnet dot com dot au
Description:
------------
the current documentation for call_user_func and
call_user_func_array does not mention that it can be
used for calling instances as well...
There is some information in one of the comments to
call_user_func.
Reproduce code:
---------------
<?php
class provider {
function myfunction($x) {
echo "burak was at $x\n";
}
}
$x= new provider();
call_user_func(array($x,'myfunction'),"a conference");
?>
Expected result:
----------------
burak was at a conference
Actual result:
--------------
The documentation does not mention that you can use
call_user_func with instance methods.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30063&edit=1