|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #6427 func_get_arg() does not support references
Submitted: 2000-08-29 21:38 UTC Modified: 2010-08-07 01:42 UTC
Avg. Score:4.6 ± 0.6
Reproduced:23 of 23 (100.0%)
Same Version:2 (8.7%)
Same OS:12 (52.2%)
From: Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.0.1pl2 OS: *
Private report: No CVE-ID: None
 [2000-08-29 21:38 UTC]
func_get_arg() does not support references (see example),

echo $o;
function test()	{
   $l=2; }

displays 1, should 2, I think it should be possible changing this without impact, if not perhaps a func_get_rarg() be fine


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-20 18:23 UTC]
I fear this cannot be done - you should pass a variable by reference from the start, otherwise you will just assign a reference to a copy.
 [2000-09-20 21:40 UTC]
a function func_get_rarg() should avoid this by treating any function parameter as a reference (if possible), moved to feature request
 [2000-09-23 12:22 UTC]
 If I possible, I would like to better understand you is what I am thinking you mean,
please correct me if I am wrong:
echo $o;
function test() {
   $a = &func_get_args();
   /** $a[0] has already been passed as a copy. We have no idea what to reference it back to! */
 [2003-01-18 14:53 UTC]
There are the same requests as this one:

Bug #14705
Bug #15098
Bug #16464

 [2010-08-07 01:42 UTC]
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-08-07 01:42 UTC]
this isn't possiblewith the engine and since PHP 5 way less needed.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 20:01:32 2024 UTC