oop - PHP SplObjectStorage Cannot create within a class -
this question has answer here:
would possible initialize protected splobjectstorage
map within class? seem running error whenever try this. similar example below:
class { protected $a = new splobjectstorage(); ... }
you need use constructor
class { public function __construct() { $this->a = new splobjectstorage(); } protected $a; ... }
Comments
Post a Comment