<?php
// cur error : Fatal error: Cannot use [] for reading in /root/n3/n3php/test.php on line 12
class foo {
public function __construct(){
$this->$m=array();
$this->$c=array();
}
public function update($m,$c){
$this->$m[]=$m;
$this->$c[]=$c;
}
public function display(){
$m=$this->$m;
for ($i=0;$i<count($m);$i++){
echo "$m[i] \n";
}
$c=$this->$c;
for ($i=0;$i<count($m);$i++){
echo "$c[i] \n";
}
}
public function f1(){
$this->update('f1','f1');
}
public function f2(){
$this->update('f2','f2');
}
public function d(){
$this->f1();
$this->f2();
$this->display();
}
}
$foo=new foo();
$foo->d();
?>