note 100812 added to language.oop5.late-static-bindings
| From: | jakub dot lopuszanski at nasza-klasa dot pl | Date: | Mon, 08 Nov 2010 18:12:48 +0000 |
| Subject: | note 100812 added to language.oop5.late-static-bindings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173864@lists.php.net to get a copy of this message | ||
Suprisingly consts are also lazy bound even though you use self instead of static:
<?php
class A{
const X=1;
const Y=self::X;
}
class B extends A{
const X=1.0;
}
var_dump(B::Y); // float(1.0)
?>
----
Server IP: 69.147.83.197
Probable Submitter: 81.190.218.49
----
Manual Page -- http://www.php.net/manual/en/language.oop5.late-static-bindings.php
Edit -- https://master.php.net/note/edit/100812
Del: integrated -- https://master.php.net/note/delete/100812/integrated
Del: useless -- https://master.php.net/note/delete/100812/useless
Del: bad code -- https://master.php.net/note/delete/100812/bad+code
Del: spam -- https://master.php.net/note/delete/100812/spam
Del: non-english -- https://master.php.net/note/delete/100812/non-english
Del: in docs -- https://master.php.net/note/delete/100812/in+docs
Del: other reasons-- https://master.php.net/note/delete/100812
Reject -- https://master.php.net/note/reject/100812
Search -- https://master.php.net/manage/user-notes.php