ID:               37351
 Updated by:       [EMAIL PROTECTED]
 Reported By:      chris at starglade dot org
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: Any
 PHP Version:      5.1.4
 New Comment:

By the time func_get_args() is being called the parameters were already
passed to the function, it's too late for making them references. You
might work-aroudn this limitation by wrapping references in an array or
using objects.


Previous Comments:
------------------------------------------------------------------------

[2008-02-15 14:42:04] thomas at koch dot ro

is the same as
http://bugs.php.net/bug.php?id=6427

------------------------------------------------------------------------

[2006-05-07 18:49:53] chris at starglade dot org

Description:
------------
func_get_args() and func_get_arg() should return variables by
reference.

Reproduce code:
---------------
<?php

$one = 'one';
$two = 'two';
$three = 'three';

function change_one_into_two_normal(&$var)
{
$var = 'two';
}

function change_one_into_two_using_get_args()
{
$args = func_get_args();
$args[0] = 'two';
}

change_one_into_two_normal($one);
echo $one;

$one = 'one';

change_one_into_two_using_get_args($one);
echo $one;

Expected result:
----------------
two
one

Actual result:
--------------
two
two


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37351&edit=1

Reply via email to