note 95860 added to language.oop5.static
| From: | valentin at balt dot name | Date: | Tue, 26 Jan 2010 15:46:45 +0000 |
| Subject: | note 95860 added to language.oop5.static | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165317@lists.php.net to get a copy of this message | ||
How to implement a one storage place based on static properties.
<?php
class a {
public function get () {
echo $this->connect();
}
}
class b extends a {
private static $a;
public function connect() {
return self::$a = 'b';
}
}
class c extends a {
private static $a;
public function connect() {
return self::$a = 'c';
}
}
$b = new b ();
$c = new c ();
$b->get();
$c->get();
?>
----
Server IP: 69.147.83.197
Probable Submitter: 217.27.58.59
----
Manual Page -- http://www.php.net/manual/en/language.oop5.static.php
Edit -- https://master.php.net/note/edit/95860
Del: integrated -- https://master.php.net/note/delete/95860/integrated
Del: useless -- https://master.php.net/note/delete/95860/useless
Del: bad code -- https://master.php.net/note/delete/95860/bad+code
Del: spam -- https://master.php.net/note/delete/95860/spam
Del: non-english -- https://master.php.net/note/delete/95860/non-english
Del: in docs -- https://master.php.net/note/delete/95860/in+docs
Del: other reasons-- https://master.php.net/note/delete/95860
Reject -- https://master.php.net/note/reject/95860
Search -- https://master.php.net/manage/user-notes.php