downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ReflectionFunction::isDisabled> <ReflectionFunction::invoke
[edit] Last updated: Fri, 24 Jun 2011

view this page in

ReflectionFunction::invokeArgs

(PHP 5 >= 5.1.0)

ReflectionFunction::invokeArgsاحضار آرگومانهای تابع

Description

public mixed ReflectionFunction::invokeArgs ( array $args )

احضار آرگومانهای تابع.

Warning

This function is currently not documented; only its argument list is available.

Parameters

args

آرگومانهای تابع برای احضار .

Return Values

See Also



add a note add a note User Contributed Notes ReflectionFunction::invokeArgs - [1 notes]
up
0
Andrea Giammarchi
5 years ago
I encountered a weird problem with ReflectionFunction, described in ticket 44139 of PHP Bugs.

If for some reason you need to call with invoke, or invokeArgs, a function like array_unshift (that accepts internally the array by reference) you could use this code to avoid the generated warning or fatal error.

<?php
function unshift(){
   
$ref        = new ReflectionFunction('array_unshift');
   
$arguments    = func_get_args();
    return       
$ref->invokeArgs(array_merge(array(&$this->arr), $arguments));
}
?>

I don't know about performances (you can create an array manually too, starting from array(&$this->something) and adding arguments). However, it seems to work correctly without problems, at least until the send by reference will be usable with one single value ...

 
show source | credits | stats | sitemap | contact | advertising | mirror sites