ID:               35052
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sam at liddicott dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux
 PHP Version:      4.4.0
 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

$this->var is the right syntax for that.


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

[2005-11-01 15:46:33] sam at liddicott dot com

Description:
------------
Indirect object array access
$var->$arrayname['item']
only takes the first letter of the array name


Reproduce code:
---------------
<?php # THIS FAILS
$name="list"; 
$obj->$name['item']='test'; 
var_dump($obj); 
?>

<?php # THIS WORKS FINE
$name="list"; 
$array=&$obj->$name;
$array['item']='test'; 
var_dump($obj); 
?>




Expected result:
----------------
object(stdClass)(1) {
  ["list"]=>
  string(4) "test"
}


Actual result:
--------------
object(stdClass)(1) {
  ["l"]=>
  string(4) "test"
}



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


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

Reply via email to