Codeigniter和ajax帖子

I make a ajax call to a codeigniter controller.

When the controller ask the database and return a json result, no problem, but when i try to access to another method in the same controller, i have an internal 500 error.

This is the working method:

public function test(){
    $query =  $this->db->query("SELECT * FROM database ORDER BY name DESC");
    $data = $query->result();
    echo json_encode($data);
}

This is when i have an internal 500 error:

public function test2(){
    $query =  $this->db->query("SELECT * FROM database ORDER BY name DESC");
    $data['query'] = $query->result();
    $data['test3'] = $this->test3();
    echo json_encode($data);
}

public function test3(){
    $testarray = array(
    'first' => array(
    'name' => 'John',
    'code' => '376'
    ),
    'AE' => array(
    'name' => 'Mike',
    'dial_code' => '971'
    ),
    'second' => array(
    'name' => 'Joe',
    'code' => '93'
    ),
    'third' => array(
    'name' => 'Emily',
    'code' => '168'
    ));
    return $testarray;
}

So, how can i prevent this error?

Edit: the error message: Fatal error: Using $this when not in object context in