#48267 [Opn->Bgs]: new "in" keyword as an alias of array_search
| From: | johannes@php.net | Date: | Wed, 13 May 2009 22:24:16 +0000 |
| Subject: | #48267 [Opn->Bgs]: new "in" keyword as an alias of array_search | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137273@lists.php.net to get a copy of this message | ||
ID: 48267
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:
We try to avoid adding keywords as that creates trouble with updates.
This particular feature has little benefit over the current, more
verbose way.
Previous Comments:
------------------------------------------------------------------------
[2009-05-13 20:04:55] zyss at mail dot zp dot ua
Description:
------------
Please add new keyword "in" to improve readability of a PHP code that
is an inline alias to array_search function.
For example:
if (array_search($item, $array)) { ... }
would be:
if ($item in $array) { ... }
Another example:
if (array_search($item, array('first', 'second', 'third'))) { ... }
would be:
if ($item in array('first', 'second', 'third')) { ... }
or ideally:
if ($item in {'first', 'second', 'third'}) { ... }
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48267&edit=1