note 113913 deleted from language.variables.scope by crell
| From: | crell@php.net | Date: | Thu, 31 Mar 2022 19:40:52 +0000 |
| Subject: | note 113913 deleted from language.variables.scope by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-217933@lists.php.net to get a copy of this message | ||
Note Submitter: Jonathan Kenigson
----
Just a note about static properties declared at class level:
class Test_Class {
static $a = 0;
public function ReturnVar(){
return $this->a;
}
}
$b = new Test_Class();
echo $b->ReturnVar();
Will not output "0" because $a is declared static. Changing "static" to
"public" or "private" will produce the output "0".