note 79552 added to language.oop5.static
| From: | Glen at osu1 dot php dot net | Date: | Mon, 03 Dec 2007 02:16:37 +0000 |
| Subject: | note 79552 added to language.oop5.static | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132758@lists.php.net to get a copy of this message | ||
Hey .. the PHP team are fixing this problem:
http://www.php.net/manual/en/language.oop5.late-static-bindings.php
Still - I'd like to post this result ... which makes an "abstract static" method
pretty useless:
<?php
abstract class A {
abstract static public function func();
public function __construct() {
self::func();
}
}
class B extends A {
public function __construct() {
parent::__construct();
}
static public function func() {
echo "YO!";
}
}
$b = new B();
?>
result... Fatal error: Cannot call abstract method A::func() in
/mnt/hgfs/flickaway/html/d/test2.php on line 14
----
Server IP: 64.71.164.2
Probable Submitter: 68.122.118.112
----
Manual Page -- http://www.php.net/manual/en/language.oop5.static.php
Edit -- https://master.php.net/note/edit/79552
Del: integrated -- https://master.php.net/note/delete/79552/integrated
Del: useless -- https://master.php.net/note/delete/79552/useless
Del: bad code -- https://master.php.net/note/delete/79552/bad+code
Del: spam -- https://master.php.net/note/delete/79552/spam
Del: non-english -- https://master.php.net/note/delete/79552/non-english
Del: in docs -- https://master.php.net/note/delete/79552/in+docs
Del: other reasons-- https://master.php.net/note/delete/79552
Reject -- https://master.php.net/note/reject/79552
Search -- https://master.php.net/manage/user-notes.php