note 45834 added to language.oop5.constants
| From: | AlexandreGravem at osu1 dot php dot net | Date: | Tue, 21 Sep 2004 01:38:44 +0000 |
| Subject: | note 45834 added to language.oop5.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77082@lists.php.net to get a copy of this message | ||
I don't know how pratical is it, but you can make a class to use like a namespace to constants:
<?php
static class Booleans {
const On = true;
const Off = false;
const Yes = true;
const No = false;
}
if ($answer == Booleans::Yes) {
//do something
}
?>
----
Manual Page -- http://www.php.net/manual/en/language.oop5.constants.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45834
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45834&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45834&report=yes
Search -- http://master.php.net/manage/user-notes.php