#30063 [Opn]: call_user_func callable for instance methods, but not documented
| From: | aidan@php.net | Date: | Sat, 11 Sep 2004 12:55:28 +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-969363990@lists.php.net to get a copy of this message | ||
ID: 30063
Updated by: aidan@php.net
Reported By: aqsalter at westnet dot com dot au
Status: Open
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
Hah,
That'll teach me.
I ponder, how can we best link that information to pages that use a
callback?
An entity?
Put it in the see-also?
Also, aqsalter, I hope this has answered your question. We'll work out
how to make the information more accessable so the problem does not
recur. Thanks for taking the time to contribute.
Previous Comments:
------------------------------------------------------------------------
[2004-09-11 13:17:27] et@php.net
Argh. "something like"
------------------------------------------------------------------------
[2004-09-11 13:16:44] et@php.net
You mean something
http://www.php.net/pseudo-types#language.types.callback
?
------------------------------------------------------------------------
[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