php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8290 allow func_*_arg?() functions as function parameters inside a function
Submitted: 2000-12-16 02:46 UTC Modified: 2002-04-28 19:09 UTC
From: cynic at mail dot cz Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3pl1 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cynic at mail dot cz
New email:
PHP Version: OS:

 

 [2000-12-16 02:46 UTC] cynic at mail dot cz
It'd be handy if one could do 

function foo()
{
     ...
     $x = bar( func_get_arg( 0 ) ) ;
     ...
} 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-16 14:31 UTC] waldschrott@php.net
agreed, maybe even (as a special case in function calls)
some constant containing the desired argument from function1
eg. __arg0, __arg1
but I guess this would be a performance loss

anyway using func_get_arg? in function calls makes sense
sometimes
 [2000-12-18 08:35 UTC] cynic at mail dot cz
no need for constants - func_get_arg() / func_get_args() does that. 
 [2000-12-18 12:56 UTC] waldschrott@php.net
I thought of something like INTERNAL_PARAM_PASSTHROUGH,
otherwise you would have to do

bar(fung_get_arg(0),func_get_arg(1),func_get_arg(2)...)

or

bar(func_get_args())
and then in bar work with an array of args
 [2002-04-28 19:09 UTC] jimw@php.net
the syntax in the original request works just fine.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Sep 09 05:00:01 2025 UTC