note 116749 added to language.constants
| From: | RaheelKhan | Date: | Sun, 22 Feb 2015 20:39:56 +0000 |
| Subject: | note 116749 added to language.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201785@lists.php.net to get a copy of this message | ||
class constant are by default public in nature but they cannot be assigned visibility factor and in
turn gives syntax error
<?php
class constants {
const MAX_VALUE = 10;
public const MIN_VALUE =1;
}
// This will work
echo constants::MAX_VALUE;
// This will return syntax error
echo constants::MIN_VALUE;
?>
----
Server IP: 72.52.91.14
Probable Submitter: 43.245.129.57
----
Manual Page -- http://php.net/manual/en/language.constants.php
Edit -- https://master.php.net/note/edit/116749
Del: integrated -- https://master.php.net/note/delete/116749/integrated
Del: useless -- https://master.php.net/note/delete/116749/useless
Del: bad code -- https://master.php.net/note/delete/116749/bad+code
Del: spam -- https://master.php.net/note/delete/116749/spam
Del: non-english -- https://master.php.net/note/delete/116749/non-english
Del: in docs -- https://master.php.net/note/delete/116749/in+docs
Del: other reasons-- https://master.php.net/note/delete/116749
Reject -- https://master.php.net/note/reject/116749
Search -- https://master.php.net/manage/user-notes.php