note 108880 added to reflectionclass.getconstant
| From: | Bhimsen | Date: | Thu, 31 May 2012 17:46:58 +0000 |
| Subject: | note 108880 added to reflectionclass.getconstant | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188348@lists.php.net to get a copy of this message | ||
The "getconstant" method can be used to get the value associated with a constant
of a particular class that you are examining.
The following code snippet shows this:
<?php
class Test{
const ONE = "Number one";
const TWO = "Number two";
}
$obj = new ReflectionClass( "Test" );
echo $obj->getconstant( "ONE" )."\n";
echo $obj->getconstant( "TWO" )."\n";
?>
output:
Number one
Number two
----
Server IP: 69.147.83.197
Probable Submitter: 49.249.117.6
----
Manual Page -- http://www.php.net/manual/en/reflectionclass.getconstant.php
Edit -- https://master.php.net/note/edit/108880
Del: integrated -- https://master.php.net/note/delete/108880/integrated
Del: useless -- https://master.php.net/note/delete/108880/useless
Del: bad code -- https://master.php.net/note/delete/108880/bad+code
Del: spam -- https://master.php.net/note/delete/108880/spam
Del: non-english -- https://master.php.net/note/delete/108880/non-english
Del: in docs -- https://master.php.net/note/delete/108880/in+docs
Del: other reasons-- https://master.php.net/note/delete/108880
Reject -- https://master.php.net/note/reject/108880
Search -- https://master.php.net/manage/user-notes.php