ID: 13884
Updated by: cnewbill
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Class/Object related
Operating System: Win98
PHP Version: 4.0.6
New Comment:

RTFM
http://www.php.net/manual/en/language.oop.php

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'];

-Chris

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

[2001-10-31 06:17:50] [EMAIL PROTECTED]

<?
 class test{
  var $items;
  function test1(){
   $this->$items['foo']='test';   
  }
 }
 $test=new test;
 $test->test1();
 echo $test->$items['bar'];
?>
last line will output "test"

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



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


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to