Req #37155 [Opn->Wfx]: func_get_args feature change request

From: Date: Sat, 05 May 2018 18:06:01 +0000
Subject: Req #37155 [Opn->Wfx]: func_get_args feature change request
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215068@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=37155&edit=1 ID: 37155 Updated by: requinix@php.net Reported by: akari dot no dot ryu at whitedragons dot org Summary: func_get_args feature change request -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: Mac OS/X PHP Version: 5.1.2 Block user comment: N Private report: N New Comment: Old request is old. I don't see a good reason for this. If it's for debugging then you can look up parameter names with Reflection. If it's for convenience (eg, SQL column names) then I would recommend against it and you should construct the array manually. If there's still any interest in making this happen then we can reopen. Previous Comments: ------------------------------------------------------------------------ [2006-04-21 14:49:53] akari dot no dot ryu at whitedragons dot org Description: ------------ Is it possible to make func_get_args return a hashed array instead of a numeric one? Possibly by adding an argument to it. Reproduce code: --------------- function changeProfileDetails($userId, $password, $surname){ echo "<!--\n"; foreach(func_get_args() as $key=>$val){ echo "$key=>$val"; } echo "-->"; } changeProfileDetails(1, "test", "whoCares"); Expected result: ---------------- <!-- userId=>1 password=>'test' surname=>'whoCares' --> Actual result: -------------- <!-- 0=>1 1=>'test' 2=>'whoCares' --> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=37155&edit=1

« previous php.bugs (#215068) next »