php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73311 "...$args" improvement: using in calls syntax
Submitted: 2016-10-13 08:00 UTC Modified: 2016-10-13 08:08 UTC
From: konstmih at gmail dot com Assigned:
Status: Duplicate Package: Class/Object related
PHP Version: Next Major Version OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 + 22 = ?
Subscribe to this entry?

 
 [2016-10-13 08:00 UTC] konstmih at gmail dot com
Description:
------------
Please add using of "...$var" syntax in function calls

Test script:
---------------
$array = [1,2,3];

$class->func1(...$array);

class Class {
  function func1($a, $b, $c) { ... }
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-13 08:08 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2016-10-13 08:08 UTC] requinix@php.net
http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list

It works, so if your code doesn't then you have a different problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC