|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13884 Arrays does not work good in objects
Submitted: 2001-10-31 06:17 UTC Modified: 2001-10-31 13:08 UTC
From: starky at udm dot ru Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.0.6 OS: Win98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
50 + 11 = ?
Subscribe to this entry?

 [2001-10-31 06:17 UTC] starky at udm dot ru
 class test{
  var $items;
  function test1(){
 $test=new test;
 echo $test->$items['bar'];
last line will output "test"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-31 13:08 UTC]

HINT: You should not be using a $

WRONG : $this->$items['foo']='test';
RIGHT : $this->items['foo']='test';

WRONG : echo $test->$items['bar']; (unless you had a global items array with items['bar'] = "items['foo']")
RIGHT : echo $test->items['bar'];

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 18:01:26 2023 UTC