note 100909 added to language.oop5.constants
| From: | jakub dot lopuszanski at nasza-klasa dot pl | Date: | Sun, 14 Nov 2010 19:20:56 +0000 |
| Subject: | note 100909 added to language.oop5.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-174027@lists.php.net to get a copy of this message | ||
Suprisingly consts are 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.constants.php
Edit -- https://master.php.net/note/edit/100909
Del: integrated -- https://master.php.net/note/delete/100909/integrated
Del: useless -- https://master.php.net/note/delete/100909/useless
Del: bad code -- https://master.php.net/note/delete/100909/bad+code
Del: spam -- https://master.php.net/note/delete/100909/spam
Del: non-english -- https://master.php.net/note/delete/100909/non-english
Del: in docs -- https://master.php.net/note/delete/100909/in+docs
Del: other reasons-- https://master.php.net/note/delete/100909
Reject -- https://master.php.net/note/reject/100909
Search -- https://master.php.net/manage/user-notes.php