php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65429 call_user_func_array can't accept params correctly
Submitted: 2013-08-09 16:48 UTC Modified: 2013-08-09 17:13 UTC
From: 1suming at sina dot com Assigned:
Status: Duplicate Package: Unknown/Other Function
PHP Version: 5.4.17 OS: windows
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: 1suming at sina dot com
New email:
PHP Version: OS:

 

 [2013-08-09 16:48 UTC] 1suming at sina dot com
Description:
------------
---
From manual page: http://www.php.net/function.call-user-func-array#refsect1-
function.call-user-func-array-description
---
class Foo
{
	 
	public function printArray(array $arr)
	{
		var_dump($arr);
	}
}

 
$foo1=new Foo();
call_user_func_array(array($foo1,'printArray'),array(1,2));
when I run,the result is
Catchable fatal error: Argument 1 passed to foo::printArray() must be of the 
type array, integer 

but when i change  call_user_func_array to call_user_func,it's ok.
Don't call_user_func_array   accept params?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-09 17:13 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2013-08-09 17:13 UTC] requinix@php.net
Duplicate of bug #65428
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Dec 03 01:03:42 2021 UTC