Bug #444

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

Added by Jochen Rau about 14 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-04-03
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

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

#1

Updated by Karsten Dambekalns about 14 years ago

  • Status changed from New to Accepted
  • Assignee 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. :)

#2

Updated by Karsten Dambekalns about 14 years ago

  • Status changed from Accepted to Resolved

Also available in: Atom PDF