From:             gutzas at moongate dot ro
Operating system: Fedora Linux
PHP version:      4.3.10
PHP Bug Type:     Unknown/Other Function
Bug description:  Bogus warning message on legitimate pass by reference w/ 
variable function name

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 <---


-- 
Edit bug report at http://bugs.php.net/?id=31606&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31606&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31606&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31606&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31606&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31606&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31606&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31606&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31606&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31606&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31606&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31606&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31606&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31606&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31606&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31606&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31606&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31606&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31606&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31606&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31606&r=mysqlcfg

Reply via email to