oop - PHP SplObjectStorage Cannot create within a class -


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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -