note 45866 deleted from language.oop5.constants by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 22 Sep 2004 19:27:41 +0000 |
| Subject: | note 45866 deleted from language.oop5.constants by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77171@lists.php.net to get a copy of this message | ||
Note Submitter: Hubert Roksor
----
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;
}
?>