Date: 05/12/01
- Next message: Joao Prado Maia: "Re: [PHP-DEV] Latest CVS on Linux"
- Previous message: derick <email protected>: "[PHP-DEV] Bug #10835 Updated: File Upload"
- In reply to: Sterling Hughes: "[PHP-DEV] call_user_*()"
- Next in thread: Sterling Hughes: "Re: [PHP-DEV] call_user_*()"
- Reply: Sterling Hughes: "Re: [PHP-DEV] call_user_*()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Sterling Hughes" <sterling <email protected>> schrieb im Newsbeitrag
news:3AFD8EF7.2030605 <email protected>
> Howdy all,
> I've been going through the call_user_*() functions in
> basic_functions.c and just a couple of notes/things I found odd.
>
> 1) With a aforementioned bug, thies was right, the following code
> fails, but it shouldn't:
>
> <?php
> function get_reference_as_arg(&$param)
> {
> var_dump($param);
> }
>
> $name = "get_reference_as_arg";
> $param1 = array(1, 2);
>
> call_user_func($name, $param1);
> ?>
>
> Fails.
>
> Whereas, replacing the call_user_func above with the following:
>
> call_user_func($name, array($param1));
Well, I thought that the function call_user_func_array() is supposed to be
called this way. What good is it anyway? I suggest 'call_user_func_array'
should
be removed as it is not needed and also doesn't work with user functions
that
expect arguments by reference.
This script fails:
<?php
function get_reference_as_arg(&$param)
{
var_dump($param);
}
$name = "get_reference_as_arg";
$param1 = array(1, 2);
call_user_func_array($name, array($param1));
?>
Regards,
Stefan Livieratos
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Joao Prado Maia: "Re: [PHP-DEV] Latest CVS on Linux"
- Previous message: derick <email protected>: "[PHP-DEV] Bug #10835 Updated: File Upload"
- In reply to: Sterling Hughes: "[PHP-DEV] call_user_*()"
- Next in thread: Sterling Hughes: "Re: [PHP-DEV] call_user_*()"
- Reply: Sterling Hughes: "Re: [PHP-DEV] call_user_*()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

