on-internet
← Community

PHP | Access to undeclared static property

Stack Overflow ·

After trying several attempts at this for some reason i get the error Access to undeclared static property when i try to make an object out my class. My class: final class repo { var $b; /** * @var \Guzzle\Http\Client */ protected $client; function repo($myvar) { static::$b = $myvar; $this->client = $b; } } Me making an object: $myobj = new repo("test");

Comments

Sign in or sign up to comment and upvote.

No comments yet.