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

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

php - facebook and github login HWIOAuthBundle and FOSUserBundle in Symfony2.1 -

hadoop - Sqoop installation export and import from postgresql -