#48268 [Opn->Bgs]: Special case of a function with single array argument

From: Date: Wed, 13 May 2009 22:22:16 +0000
Subject: #48268 [Opn->Bgs]: Special case of a function with single array argument
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137272@lists.php.net to get a copy of this message
 ID:               48268
 Updated by:       johannes@php.net
 Reported By:      zyss at mail dot zp dot ua
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Irrelevant
 PHP Version:      5.2.9
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2009-05-13 20:20:25] 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);



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48268&edit=1



Thread (2 messages)

« previous php.bugs (#137272) next »