note 126910 added to functions.arguments
| From: | Simmo at 9000 dot 000 | Date: | Wed, 09 Mar 2022 05:13:31 +0000 |
| Subject: | note 126910 added to functions.arguments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217701@lists.php.net to get a copy of this message | ||
For anyone just getting started with php or searching, for an understanding, on what this page
describes as a "... token" in Variable-length arguments:
https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list
<?php
func($a, ...$b)
?>
The 3 dots, or elipsis, or "...", or dot dot dot is sometimes called the "spread
operator" in other languages.
As this is only used in function arguments, it is probably not technically an true operator in PHP.
(As of 8.1 at least?).
(With having an difficult to search for name like "... token", I hope this note helps
someone).
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 180.150.43.242)
----
Manual Page -- https://php.net/manual/en/functions.arguments.php
Edit -- https://main.php.net/note/edit/126910
Del: integrated -- https://main.php.net/note/delete/126910/integrated
Del: useless -- https://main.php.net/note/delete/126910/useless
Del: bad code -- https://main.php.net/note/delete/126910/bad+code
Del: spam -- https://main.php.net/note/delete/126910/spam
Del: non-english -- https://main.php.net/note/delete/126910/non-english
Del: in docs -- https://main.php.net/note/delete/126910/in+docs
Del: other reasons-- https://main.php.net/note/delete/126910
Reject -- https://main.php.net/note/reject/126910
Search -- https://main.php.net/manage/user-notes.php