BzZzZ - ustvarjamo podobe logo
slovenščina
english
Solving call_user_func_array() expects parameter 2 to be array, object given

After upgrade to PHP 5.3. you might start getting this error, if you were passing an object to function callbacks:

"call_user_func_array() expects parameter 2 to be array, object given".

 

To solve this simply wrap object in an array like this array($object) or typecast it to array (array)$object. If your function expexcts object by reference, you will need to pass it by reference at callback call time like this, typecasting won't work here as it breaks reference:

$sth = call_user_func_array(array('modRokNewsPagerHelper', 'getRowCount' ), array(&$params) );

 

One of the places where this applies is when you are using Joomla callback cache, which uses call_user_func_array to process your callbacks.
 
  • strateško usmerjeno
  • integrirano
  • s kreativnostjo pospešeno
  • učinkovito komuniciranje
© BzZzZ 2008
stik z nami    zaposlitev    kazalo strani