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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 25 06:01:24 2020 UTC