note 114599 added to language.oop5.constants
| From: | XiongChiamiov | Date: | Mon, 10 Mar 2014 23:36:49 +0000 |
| Subject: | note 114599 added to language.oop5.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198855@lists.php.net to get a copy of this message | ||
const can also be used directly in namespaces, a feature never explicitly stated in the
documentation.
<?php
# foo.php
namespace Foo;
const BAR = 1;
?>
<?php
# bar.php
require 'foo.php';
var_dump(Foo\BAR); // => int(1)
?>
----
Server IP: 72.52.91.14
Probable Submitter: 72.29.166.164
----
Manual Page -- http://php.net/manual/en/language.oop5.constants.php
Edit -- https://master.php.net/note/edit/114599
Del: integrated -- https://master.php.net/note/delete/114599/integrated
Del: useless -- https://master.php.net/note/delete/114599/useless
Del: bad code -- https://master.php.net/note/delete/114599/bad+code
Del: spam -- https://master.php.net/note/delete/114599/spam
Del: non-english -- https://master.php.net/note/delete/114599/non-english
Del: in docs -- https://master.php.net/note/delete/114599/in+docs
Del: other reasons-- https://master.php.net/note/delete/114599
Reject -- https://master.php.net/note/reject/114599
Search -- https://master.php.net/manage/user-notes.php