note 129097 added to language.oop5.abstract
| From: | qnnp at main dot php dot net | Date: | Sun, 10 Dec 2023 05:21:06 +0000 |
| Subject: | note 129097 added to language.oop5.abstract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221051@lists.php.net to get a copy of this message | ||
<?php
abstract class test {
protected static string $test;
public static function load( $test ): void {
static::$test = $test;
}
public static function get(): void {
echo static::$test;
}
}
class a extends test {
public static function load( $test ): void {
parent::load( $test );
}
}
class b extends test {
public static function load( $test ): void {
parent::load( $test );
}
}
class c extends test {
protected static string $test;
public static function load( $test ): void {
parent::load( $test );
}
}
a::load( 'a' );
b::load( 'b' );
c::load( 'c' );
a::get(); // will echo b
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 2408:823c:7e00:a896:2c3f:420c:1c82:2dec)
----
Manual Page -- https://php.net/manual/en/language.oop5.abstract.php
Edit -- https://main.php.net/note/edit/129097
Del: integrated -- https://main.php.net/note/delete/129097/integrated
Del: useless -- https://main.php.net/note/delete/129097/useless
Del: bad code -- https://main.php.net/note/delete/129097/bad+code
Del: spam -- https://main.php.net/note/delete/129097/spam
Del: non-english -- https://main.php.net/note/delete/129097/non-english
Del: in docs -- https://main.php.net/note/delete/129097/in+docs
Del: other reasons-- https://main.php.net/note/delete/129097
Reject -- https://main.php.net/note/reject/129097
Search -- https://main.php.net/manage/user-notes.php