Bug #65429 [Opn->Dup]: call_user_func_array can't accept params correctly

From: Date: Fri, 09 Aug 2013 17:13:03 +0000
Subject: Bug #65429 [Opn->Dup]: call_user_func_array can't accept params correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-180828@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65429&edit=1

 ID:                 65429
 Updated by:         requinix@php.net
 Reported by:        1suming at sina dot com
 Summary:            call_user_func_array can't accept params correctly
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   windows
 PHP Version:        5.4.17
 Block user comment: N
 Private report:     N

 New Comment:

Duplicate of bug #65428


Previous Comments:
------------------------------------------------------------------------
[2013-08-09 16:48:36] 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?



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65429&edit=1


Thread (2 messages)

« previous php.bugs (#180828) next »