|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-17 16:55 UTC] joffrey at coolhaven dot info
[2009-03-17 17:43 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
Description: ------------ Calling func_get_args() returns copies of the arguments of the function. It would be more useful to return referenced values if those are defined in the function parameters. This is useful when using func_get_args() for function parameter overloading and calling other functions from a function using call_user_func_array(). A bit off topic: I see var_dump is aware if the variable is a referenced one. Would it be possible to implement a 'is_reference()' function now? Reproduce code: --------------- $a = 1; $b = 2; $c = "3"; function f($a, &$b, &$c) { var_dump(func_get_args()); } var_dump(array($a, &$b, &$c)); f($a, $b, $c); Expected result: ---------------- array(3) { [0]=> int(1) [1]=> ∫(2) [2]=> &string(1) "3" } array(3) { [0]=> int(1) [1]=> ∫(2) [2]=> &string(1) "3" } Actual result: -------------- array(3) { [0]=> int(1) [1]=> ∫(2) [2]=> &string(1) "3" } array(3) { [0]=> int(1) [1]=> int(2) [2]=> string(1) "3" }