Reputation: 273
Would it be possible to initialize a protected SplObjectStorage
as a map within a class? I seem to be running into an error whenever I try this. Similar to example below:
class a {
protected $a = new SplObjectStorage();
...
}
Upvotes: 0
Views: 139
Reputation: 12025
you need to use constructor
class a {
public function __construct() {
$this->a = new SplObjectStorage();
}
protected $a;
...
}
Upvotes: 0