php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68436 Ambiguous PHP versions stated in description
Submitted: 2014-11-17 16:03 UTC Modified: 2014-11-17 16:13 UTC
From: pjanko at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pjanko at gmail dot com
New email:
PHP Version: OS:

 

 [2014-11-17 16:03 UTC] pjanko at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.call-user-func-array
---

Example #2 call_user_func_array() using namespace name
(...)
// As of PHP 5.3.0
call_user_func_array(__NAMESPACE__ .'\Foo::test', array('Hannes'));

// As of PHP 5.3.0
call_user_func_array(array(__NAMESPACE__ .'\Foo', 'test'), array('Philip'));


Expected result:
----------------
// As of PHP < 5.3.0
call_user_func_array(array(__NAMESPACE__ .'\Foo', 'test'), array('Philip'));


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-17 16:13 UTC] salathe@php.net
-Status: Open +Status: Not a bug
 [2014-11-17 16:13 UTC] salathe@php.net
The comments are correct, both of those lines of code will work as of PHP 5.3.0.  The second line uses the array($class, $method) style but uses the namespace feature so requires PHP 5.3.0 or higher.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC