Bug #444
"func_get_args()" is not allowed to be an argument
Status: | Resolved | Start date: | 2008-04-03 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 100% |
|
Category: | - | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow 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
Associated revisions
Fixed bug #444. Thanks to the auction winner!
History
#1 Updated by Karsten Dambekalns over 7 years ago
- 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. :)
#2 Updated by Karsten Dambekalns over 7 years ago
- Status changed from Accepted to Resolved