Posted by petermichaux on 09/17/05 22:07
Oops. I have figured out how to test this problem with error-reporting
enabled.
However it looks like I over simplified my problem and my question
still remains. Here is an improved version of my question. In the
following code there are no errors reported. However, if I uncomment
the one comment then I will get an error "Undefined index: bar ".
Any ideas why I can use the undefined index 'bar' in $this->mArray as
long as $this->mArray has never been initiated/used?
Thanks again,
Peter
class MyClass
{
private $mArray;
public function PrintArrayElement()
{
//$this->mArray['foo']=3;
echo $this->mArray['bar'];
}
}
$my_class = new MyClass;
$my_class->PrintArrayElement();
Navigation:
[Reply to this message]
|