Well, first off, you don't need to parent::$this->arraybase(). Just do $this->arraybase(). In fact, I'm not even sure your way is even valid syntax. But I digress.
As for your specific problem, you can either:
Add a constructor (and remove the ->arraybase() call from addArray()):
public function __construct() {
$this->array = new ArrayObject();
}
Add an if check around the call to ->arraybase():
public function addArray($value) {
if (!isset($this->array) || !is_object($this->array)) {
$this->arraybase();
}
...
}
Personally, I'd do #1. It's going to be more reliable, faster, and more in keeping with OOP paradigms.
EDIT: Adding Constructor Info
So, if your base class has this constructor:
public function __construct($some, $vars) {
......
}
You would do this in your extending class:
public function __construct($some, $vars) {
parent::__construct($some, $vars);
$this->array = new ArrayObject();
}
NOTE: Don't call parent::__construct() unless one of the parents has a __construct method...