私はPHPOOPを初めて使用し、配列を元に戻すのに問題があります。
class example
{
public $array;
public function __construct()
{
$this->array = array();
}
public function do_work()
{
$this->array[] = 'test';
}
}
$test = new example();
$test->do_work();
$test->array;
'test'の代わりに空の配列を取得し続けます。私は何が間違っているのですか?