note 120080 added to language.constants
| From: | ours33 dot choubleuapoidviolet at gmail dot com | Date: | Mon, 24 Oct 2016 15:56:52 +0000 |
| Subject: | note 120080 added to language.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206946@lists.php.net to get a copy of this message | ||
You can also call a constant as an object property:
const MY_CONSTANT = 'foo'
$this->{MY_CONSTANT};
$object->{MY_CONSTANT};
this is the same as:
$this->foo;
$object->foo;
It's very usefull for dynamic property.
----
Server IP: 72.52.91.14
Probable Submitter: 37.58.139.53
----
Manual Page -- http://php.net/manual/en/language.constants.php
Edit -- https://master.php.net/note/edit/120080
Del: integrated -- https://master.php.net/note/delete/120080/integrated
Del: useless -- https://master.php.net/note/delete/120080/useless
Del: bad code -- https://master.php.net/note/delete/120080/bad+code
Del: spam -- https://master.php.net/note/delete/120080/spam
Del: non-english -- https://master.php.net/note/delete/120080/non-english
Del: in docs -- https://master.php.net/note/delete/120080/in+docs
Del: other reasons-- https://master.php.net/note/delete/120080
Reject -- https://master.php.net/note/reject/120080
Search -- https://master.php.net/manage/user-notes.php