Call_user_func with PDO problem [PHP]



I’m trying to use call_user_func on dreamhost with pdo and don’t work. On my localhost ubuntu machine works.

Dreamhost: 5.2, 5.3 (FastCGI and CGI I already tried)
Local machine: PHP 5.3.10, Apache/2.2.22

Any ideas why i can’t use pdo with call_user_func?

[php]function do_query($function){
$db = new_pdo(db_config()); // No details
$value = call_user_func_array($function, array($db)); // Why I can’t do this?
$db = null;
return $value;
catch(PDOException $e){
return false;
function test_query($db){
$stm = $db->prepare(“select * from users where id = :id”);
var_dump($stm->errorInfo()); // This code throw 'Cannot execute queries while other unbuffered queries are active’
return $stm->fetchAll(); //No data


//Avoiding call_user_func
$db = new_pdo(db_config()); //No details
$stm = $db->prepare(“select * from users where id = :id”);
var_dump($stm->errorInfo()); // No error
$stm->fetchAll(); // Works fine