PHP | ReflectionFunction invokeArgs() Function Last Updated : 19 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The ReflectionFunction::invokeArgs() function is an inbuilt function in PHP which is used to return the result of the invoked function call. Syntax: mixed ReflectionFunction::invokeArgs( array $args ) Parameters: This function accepts a single parameter $args which holds the array of arguments passed to the called function. Return Value: This function returns the result of the invoked function call. Below programs illustrate the ReflectionFunction::invokeArgs() function in PHP: Program 1: php <?php // Initializing a user-defined function function Company($Company_Name, $Role) { return sprintf("%s %s\r\n", $Company_Name, $Role); } // Using ReflectionFunction() over the specified // function company $function = new ReflectionFunction('company'); // Calling the invokeArgs() function $A = $function->invokeArgs(array('GeeksforGeeks', 'is a Computer Science Portal.')); // Getting the result of the invoked // function company echo $A; ?> Output: GeeksforGeeks is a Computer Science Portal. Program_2: php <?php // Initializing some user-defined functions function Trial1($First_Args, $Second_Args) { return sprintf("%s %s\r\n", $First_Args, $Second_Args); } function Trial2($First_Args, $Second_Args) { return sprintf("%s %s\r\n", $First_Args, $Second_Args); } // Using ReflectionFunction() over the above // specified functions $function = new ReflectionFunction('Trial1'); $function = new ReflectionFunction('Trial2'); // Calling the invokeArgs() function and the // result of the invoked function company echo $function->invokeArgs(array('a+a', '= 2a')); echo $function->invokeArgs(array('a*a', '= a^2')); ?> Output: a+a = 2a a*a = a^2 Reference: https://www.php.net/manual/en/reflectionfunction.invokeargs.php Create Quiz Comment K Kanchan_Ray Follow 0 Improve K Kanchan_Ray Follow 0 Improve Article Tags : Web Technologies PHP PHP-function PHP- Reflection Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like