#48903 [Opn->Bgs]: Lambda function as array index
| From: | colder@php.net | Date: | Mon, 13 Jul 2009 13:34:25 +0000 |
| Subject: | #48903 [Opn->Bgs]: Lambda function as array index | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-139688@lists.php.net to get a copy of this message | ||
ID: 48903
Updated by: colder@php.net
Reported By: ninzya at inbox dot lv
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows XP
PHP Version: 5.3.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
You can't, as usual, use objects as array keys.
Check out SplObjectStorage.
Previous Comments:
------------------------------------------------------------------------
[2009-07-13 13:29:35] ninzya at inbox dot lv
Description:
------------
See reproduce code.
Reproduce code:
---------------
<?php
$arr =array();
$arr[function(){return 5;}] ='Stepanov';
var_dump( $arr);
?>
Expected result:
----------------
array(1) {
[5]=>
string(8) "Stepanov"
}
Actual result:
--------------
Warning: Illegal offset type in D:\...\index.php on line 5
array(0) {
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48903&edit=1