note 110405 added to function.func-get-args
| From: | jmadsen | Date: | Fri, 19 Oct 2012 09:24:44 +0000 |
| Subject: | note 110405 added to function.func-get-args | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191430@lists.php.net to get a copy of this message | ||
Interesting to note this shortcut
func_get_args()[0];
as in:
<?php
$params = array('type'=>'large', 'id'=>15);
my_func($params);
function my_func()
{
$params = func_get_args()[0];
var_dump($params);
}
array(2) { [0]=> string(5) "large" [1]=> int(2)15 }
?>
----
Server IP: 69.147.83.199
Probable Submitter: 61.205.154.99
----
Manual Page -- http://www.php.net/manual/en/function.func-get-args.php
Edit -- https://master.php.net/note/edit/110405
Del: integrated -- https://master.php.net/note/delete/110405/integrated
Del: useless -- https://master.php.net/note/delete/110405/useless
Del: bad code -- https://master.php.net/note/delete/110405/bad+code
Del: spam -- https://master.php.net/note/delete/110405/spam
Del: non-english -- https://master.php.net/note/delete/110405/non-english
Del: in docs -- https://master.php.net/note/delete/110405/in+docs
Del: other reasons-- https://master.php.net/note/delete/110405
Reject -- https://master.php.net/note/reject/110405
Search -- https://master.php.net/manage/user-notes.php