note 45866 added to language.oop5.constants
| From: | HubertRoksor at osu1 dot php dot net | Date: | Wed, 22 Sep 2004 01:05:15 +0000 |
| Subject: | note 45866 added to language.oop5.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77134@lists.php.net to get a copy of this message | ||
It might not be obvious but you can check for the existence of an Object Constant the same way as
for a normal constant, by using defined().
<?php
class myclass
{
const MYCONST = 'checked';
}
if (defined('myclass:MYCONST'))
{
echo myclass:MYCONST;
}
?>
----
Manual Page -- http://www.php.net/manual/en/language.oop5.constants.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45866
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45866&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45866&report=yes
Search -- http://master.php.net/manage/user-notes.php