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

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

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