Mantis - Quercus
Viewing Issue Advanced Details
2882 major always 08-29-08 08:18 09-03-08 23:47
koreth  
nam  
high  
closed 3.2.1  
fixed  
none    
none 3.2.1  
0002882: Class method can't access private array field
<?php
class Foo {
  private $arr;
  private $scalar;

  public function Foo() {
    $this->scalar = 1;
    $this->arr = array();
  }

  public function test() {
    $this->scalar = 2;
    $this->arr['beep'] = 1;
  }
}

$foo = new Foo();
$foo->test();


This dies with "Fatal Error: Can't access private field 'Foo::arr'". Note that the access to Foo::scalar is fine; it's just the array access that fails.

Notes
(0003379)
nam   
09-03-08 23:47   
php/091l