Bug #444

"func_get_args()" is not allowed to be an argument

Added by Jochen Rau 94 days ago. Updated 93 days ago.

Status :Resolved Start :2008-04-03
Priority :Should have Due date :
Assigned to :Karsten Dambekalns % Done :

100%

Category :-
Target version :-

Description

Hi,

The method "getComponent()" in the class "F3_FLOW3_Component_Manager" has the following call:

$this->getOverridingConstructorArguments($componentConfiguration, array_slice(func_get_args(), 1))

But "func_get_args()" is not allowed to be an argument. The PHP-Documentation says:

----
Note: Because this function depends on the current scope to determine parameter details, it cannot be used as a function parameter. If you must pass this value, assign the results to a variable, and pass the variable.
----

I changed the order of the arguments and got the following error message:

Fatal error: func_get_args(): Can't be used as a function parameter in /Applications/MAMP/htdocs/flow3/Packages/FLOW3/Classes/Component/F3_FLOW3_Component_Manager.php on line 125

Whether the function call produces an error or not obviously depends on the order of the arguments. This may be a bug in PHP 5.2.x..

I introduced a variable "$arguments" and solved the problem for me:

$arguments = array_slice(func_get_args(), 1);
$overridingConstructorArguments = $this->getOverridingConstructorArguments($arguments, $componentConfiguration);

Greetings
Jochen

History

2008-04-03 21:56 - Karsten Dambekalns

  • Status changed from New to Accepted
  • Assigned to set to Karsten Dambekalns
  • % Done changed from 0 to 100

Fixed in SVN as of now. Thanks to Jochen Rau for finding this. And thanks to the crazy bidders at T3BOARD08. :)

2008-04-03 21:57 - Karsten Dambekalns

  • Status changed from Accepted to Resolved

Also available in: Atom PDF