consider the following:
class abc {
var $dummy;
function abc($blah) {
$this->dummy = array($blah,$blah,$blah);
}
function dummy_return() {
return $this->dummy;
}
$temp = new abc("hi");
echo $temp->dummy_return()[1];
// $dum = $temp->dummy_return();
// echo $dum[1];
the "echo $temp->dummy_return()[1];" line gives me the error:
"Parse error: parse error, expecting ','' or';'' in.......".
However, the next two lines (commented out) DO work. notice they are functionally equivalent, but PHP gives me a parse error when I try to combine it into one line. WHY? And, how do I combine them without causing PHP to crap out on me?