Req #55095 [Opn->Bgs]: idea/request for new array_function
Edit report at https://bugs.php.net/bug.php?id=55095&edit=1
ID: 55095
Updated by: rasmus@php.net
Reported by: anticom at hotmail dot de
Summary: idea/request for new array_function
-Status: Open
+Status: Bogus
Type: Feature/Change Request
Package: Arrays related
Operating System: Windows Vista 32Bit
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
echo array_keys($arr)[1]; // PHP 5.4
Previous Comments:
------------------------------------------------------------------------
[2011-06-30 23:42:02] anticom at hotmail dot de
Description:
------------
I realy would prefer a function for associative arrays, enableing to get an index-specific key.
This would be usefull especialy for big array's, so you have to iterate through them, to get a
specific key. The other advantage would be, that you could iterate through the array manually with a
for-loop, without having to store all the key's in a temporary array using array_keys()
Test script:
---------------
<?php
$arr = array("foo" => 'bar', "secondFoo" => 'anyval');
echo array_getKeyAt($arr, 1);
?>
Expected result:
----------------
output would be:
secondFoo
Actual result:
--------------
[function not implemented yet afaik]
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55095&edit=1
Thread (4 messages)