ReflectionClass::hasConstant
(PHP 5 >= 5.1.0)
ReflectionClass::hasConstant — بررسی تعریف شدن ثابت
Description
public bool ReflectionClass::hasConstant
( string $name
)
بررسی تعریف شدن ثابت خاص توسط کلاس.
Parameters
- name
-
نام ثابت برای بررسی.
Return Values
TRUE بررسی تعریف شدن ثابت در غیر این صورت FALSE.
Examples
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)
See Also
- ReflectionClass::hasMethod() - بررسی تعریف شدن متد
- ReflectionClass::hasProperty() - بررسی تعریف شدن خاصیت
There are no user contributed notes for this page.
