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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC