php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #48268 Special case of a function with single array argument
Submitted: 2009-05-13 20:20 UTC Modified: 2009-05-13 22:22 UTC
From: zyss at mail dot zp dot ua Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.9 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: zyss at mail dot zp dot ua
New email:
PHP Version: OS:

 

 [2009-05-13 20:20 UTC] zyss at mail dot zp dot ua
Description:
------------
I propose to add a special syntax (simplification) for a function declared with just one argument. The idea is to remove array with its brackets ( ) in the function call to improve readability and get rid of unneeded array keyword. This feature is expected by many people who use such type of functions as a replacement of the PHP's missing feature to specify function's arguments by name.

For example:

  function setParams(array $params) { /*...*/ }

Current call:

  setParams(array('name' => 'foo', 'width' => 300, 'height' => 150));

Proposed call:

  setParams('name' => 'foo', 'width' => 300, 'height' => 150);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-13 22:22 UTC] johannes@php.net
This has been discussed multiple times ad is not planned for future releases. Please check archives of the "internals" list for in-depth discussions and arguements.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 11:01:37 2025 UTC