Re: PHP 4.0 Bug #8290 Updated: allow func_*_arg?() functions as function parameters inside a function

From: Date: Mon, 18 Dec 2000 18:11:28 +0000
Subject: Re: PHP 4.0 Bug #8290 Updated: allow func_*_arg?() functions as function parameters inside a function
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-41803@lists.php.net to get a copy of this message
Those few keystrokes aren't such a PITA... Anyway, in most cases, when I need more than 1 argument, or use it in more than just one place, I assign them in the beginning of the function's body. However, when the body's reasonably short to prevent obfuscation, and in quite a few different sets of circumstances, st like foo() { $x = bar( $arg1 = func_get_arg( 0 ) ) ; ... } ; comes in handy. At 18:56 18.12. 2000, Bug Database wrote the following: -------------------------------------------------------------- >ID: 8290 >Updated by: waldschrott >Reported By: cynic@mail.cz >Status: Analyzed >Bug Type: Feature/Change Request >Assigned To: >Comments: > >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 > >Previous Comments: >--------------------------------------------------------------------------- > >[2000-12-18 08:35:48] cynic@mail.cz >no need for constants - func_get_arg() / func_get_args() does that. > >--------------------------------------------------------------------------- > >[2000-12-16 14:31:56] 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-16 02:46:32] cynic@mail.cz >It'd be handy if one could do > >function foo() >{ > ... > $x = bar( func_get_arg( 0 ) ) ; > ... >} > >--------------------------------------------------------------------------- > > >Full Bug description available at: http://bugs.php.net/?id=8290 ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. cynic@mail.cz ICQ: 2808 2505

« previous php.dev (#41803) next »