(PHP 5 >= 5.1.0)
ReflectionClass::hasConstant — بررسی تعریف شدن ثابت
بررسی تعریف شدن ثابت خاص توسط کلاس.
نام ثابت برای بررسی.
TRUE بررسی تعریف شدن ثابت در غیر این صورت FALSE.
Example #1 مثال ReflectionClass::hasConstant()
<?php
class Foo {
const c1 = 1;
}
$class = new ReflectionClass("Foo");
var_dump($class->hasConstant("c1"));
var_dump($class->hasConstant("c2"));
?>
The above example will output something similar to:
bool(true) bool(false)