PHP 4.0 Bug #5350 Updated: call_function("function_name", array args); ala execv()
| From: | cynic@php.net | Date: | Sun, 21 Jan 2001 09:01:01 +0000 |
| Subject: | PHP 4.0 Bug #5350 Updated: call_function("function_name", array args); ala execv() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-44667@lists.php.net to get a copy of this message | ||
ID: 5350
Updated by: cynic
Reported By: drago@0x00.org
Old-Status: Analyzed
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
call_user_func_array()
Previous Comments:
---------------------------------------------------------------------------
[2000-08-15 10:45:19] waldschrott@php.net
that possibly makes sense, you´ve currently no option but using eval() to transorm passed array
args to an argument list...
---------------------------------------------------------------------------
[2000-07-04 15:02:07] drago@0x00.org
I am looking to use this with existing PHP functions, not user space ones.
Specifically I would like to use this with ibase_execute() for the bindings.
I am writting a little database wrapper and I need to be able to do...
$res=DB("select * from Foo where bar=?", $reallygeeky);
and that arg list is of variable length so I want to be able to do my custom stuff in DB() then toss
the args in an array and call ibase_execute.
I have it working as it is, but it is ugly. Right now I am building up eval() code and having it
return the resource into a global var. Its ugly :)
Would be much easier if I could just build up an array and call
call_function("ibase_execute", $theargs);
---------------------------------------------------------------------------
[2000-07-04 10:36:23] stas@cvs.php.net
What prevents you from doing:
$func(array("foo", "bar", "geek")) and opening that array in function?
---------------------------------------------------------------------------
[2000-07-04 04:53:47] drago@0x00.org
$args=array("foo", "bar", "geek");
call_function("f", $args);
function f($f1, $f2, $f3) {
echo "$f1 $f2 $f3";
}
Output: foo bar geek
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=5350