Doc #54130 [Opn->Fbk]: call_user_func description is too general
| From: | frozenfire@php.net | Date: | Mon, 05 Dec 2011 23:00:41 +0000 |
| Subject: | Doc #54130 [Opn->Fbk]: call_user_func description is too general | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7591@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54130&edit=1
ID: 54130
Updated by: frozenfire@php.net
Reported by: ajrattink at correct dot net
Summary: call_user_func description is too general
-Status: Open
+Status: Feedback
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.5
-Assigned To:
+Assigned To: frozenfire
Block user comment: N
Private report: N
New Comment:
So, just to clarify what you're saying: It's not currently possible to use
call_user_func with a callback pointing to a static method in an imported class?
If that's the case, this seems more like a Zend bug than anything
(zend_call_function is what handles these calls).
Previous Comments:
------------------------------------------------------------------------
[2011-03-01 17:03:57] ajrattink at correct dot net
Description:
------------
---
From manual page: http://www.php.net/function.call-user-func#Parameters
---
The manual states that call_user_func(array($classname, $methname), ...)
will call the static method of the class indicated by +classname+ but fails to mention that it does
not work if the class is imported in a namespace.
To avoid disappointed programmers, I think it should.
Example:
use X as Y;
call_user_func(array('Y', 'f'), ...)
will not work. This means that if the original class caused a nameconflict there is absolutely no
way of calling it. Ever.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54130&edit=1