php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80196 Hard to find documentation on argument unpacking
Submitted: 2020-10-07 10:18 UTC Modified: 2025-04-25 15:29 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: yohan at ylab dot nl Assigned: vrana (profile)
Status: Closed Package: *General Issues
PHP Version: Irrelevant OS: Irrelevant
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: yohan at ylab dot nl
New email:
PHP Version: OS:

 

 [2020-10-07 10:18 UTC] yohan at ylab dot nl
Description:
------------
I find it hard to find reference documentation on argument unpacking, aka the spread operator, aka the splat operator, aka the ... operator, aka the ... token.

It's mentioned as new feature on several places: 

https://www.php.net/manual/en/migration56.new-features.php
https://www.php.net/manual/en/migration74.new-features.php
https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list.new

I would appreciate a complete reference page on argument unpacking, with examples and version info (comparable to https://www.php.net/manual/en/language.operators.errorcontrol.php).


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2024-07-10 05:53 UTC] krina234pestro at outlook dot com
This feature is particularly useful when you have a list of arguments in an array and you want to pass them to a function without manually indexing each element.(https://github.com)(https://www-lhiproviderportal.com)
 [2025-04-25 14:22 UTC] vrana@php.net
-Status: Open +Status: Closed -Package: Documentation problem +Package: *General Issues -Assigned To: +Assigned To: vrana
 [2025-04-25 15:29 UTC] yohan at ylab dot nl
@Vrana: the url you post is one of the places where the ... token is mentioned, as I wrote in the initial description. 
But using the ... token for a variable-length function argument is just one use case. 
Other uses of the ... token are not documented, unlike most other operators
(https://www.php.net/manual/en/language.operators.php).
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 07:01:28 2025 UTC