call_user_func_array error

If you catch any bug, please report it here

call_user_func_array error

Postby Outlaw » Tue Mar 02, 2010 12:33 pm

I have discovered a bug(?) in call_user_func_array

Code: Select all
function testfunc($a,$b)
{
   return $a." test ".$b;
}

$ajax = new PHPLiveX();
$ajax->Ajaxify(array("testfunc"));
$ajax->Run();


works but

Code: Select all

2.php
function testfunc($a,$b)
{
   return $a." test ".$b;
}

1.php
include("2.php");
$ajax = new PHPLiveX();
$ajax->Ajaxify(array("testfunc"));
$ajax->Run();


gives me this error:

Code: Select all
PHP Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'testfunc' was given in E:\test\PHPLiveX.php on line 178


According to function_exists the function is there and its also callable. Can you help me on how to fix this problem? Thanks in advance and keep the good work up :)
Outlaw
Beginner
 
Posts: 2
Joined: Tue Mar 02, 2010 12:21 pm

Re: call_user_func_array error

Postby Outlaw » Tue Mar 02, 2010 1:19 pm

ok I found the problem.

Code: Select all
include("x.php");
$ajax->AjaxifyObjectMethods($classes);
$ajax->Ajaxify($functions);


works

Code: Select all
$ajax->AjaxifyObjectMethods($classes);
include("x.php");
$ajax->Ajaxify($functions);


does not work and gives the call_user_func_array error on functions that are included after AjaxifyObjectMethods is called.
Outlaw
Beginner
 
Posts: 2
Joined: Tue Mar 02, 2010 12:21 pm

Re: call_user_func_array error

Postby ardabeyaz » Thu Mar 04, 2010 3:43 pm

Thanks Outlaw, I'll consider it for the next release
Arda Beyazoğlu - Web Developer
PHPLiveX Core Developer
ardabeyaz
Core Developer
 
Posts: 127
Joined: Thu Sep 27, 2007 6:27 pm
Location: Istanbul


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron