PHP | Access to undeclared static property
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");
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.