|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-19 11:07 UTC] derick@php.net
[2005-01-19 11:59 UTC] gutzas at moongate dot ro
[2005-01-19 12:40 UTC] derick@php.net
[2005-01-19 12:42 UTC] gutzas at moongate dot ro
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 23:00:01 2025 UTC |
Description: ------------ Passing by reference when the function is called as variable generates a warning message, even if the function does accept its parameters by reference. The actual behaviour is however correct, even though the warning says that the argument has been passed by value. This is a major problem for intensively used sites where this functionality is needed and warning messages are logged because the logs grow to unmanageable sizes really fast. Reproduce code: --------------- <? function foo(&$param) { $param++; } $function_name='foo'; $myParam=1; $function_name(&$myParam); echo("\n---> $myParam <---\n"); ?> Expected result: ---------------- ---> 2 <--- Actual result: -------------- <br /> <b>Warning</b>: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in <b>/var/www/html/mgv/dev/helpdesk_root/helpdesk/test_reference.php</b> on line <b>10</b><br /> ---> 2 <---