|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: starky at udm dot ru
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 15:01:36 2024 UTC