#42623 [Opn->Bgs]: Dynamically accessing array properties
| From: | iliaa@php.net | Date: | Tue, 11 Sep 2007 15:55:40 +0000 |
| Subject: | #42623 [Opn->Bgs]: Dynamically accessing array properties | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117399@lists.php.net to get a copy of this message | ||
ID: 42623
Updated by: iliaa@php.net
Reported By: adrian dot gheorghe at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Windows
PHP Version: 5.2.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
When you pass 'a["b"]', the entire expression is considered to be a
string and as such is interpreted as a property name.
Previous Comments:
------------------------------------------------------------------------
[2007-09-11 12:40:52] adrian dot gheorghe at gmail dot com
Description:
------------
This is a continuation of #42622 - I'm sorry I had to open a new bug
report, but the old one was marked as bogus and could not comment on it.
Reproduce code:
---------------
class Foo
{
function example( $name )
{
$bar = $this->getBar();
echo $bar->$name;
}
}
Expected result:
----------------
Should work for both example('abc') and example('a["b"]')
Actual result:
--------------
Doesn't work for example('a["b"]')
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42623&edit=1