The ReflectionClassConstant sınıfı

(PHP 7 >= 7.1.0, PHP 8)

Giriş

ReflectionClassConstant sınıfı bir sınıf sabiti hakkında bilgi verir.

Sınıf Sözdizimi

ReflectionClassConstant implements Reflector {
/* Sabitler */
const int IS_PUBLIC = 1 ;
const int IS_PROTECTED = 2 ;
const int IS_PRIVATE = 4 ;
/* Özellikler */
public $name;
public $class;
/* Yöntemler */
public __construct(object|string $class, string $constant)
public static export(mixed $class, string $name, bool $return = ?): string
public getAttributes(string $name = null, int $flags = 0): array
public getDocComment(): string|false
public getModifiers(): int
public getName(): string|false
public getValue(): mixed
public isPrivate(): bool
public isProtected(): bool
public isPublic(): bool
public __toString(): string
}

Özellikler

name

Sınıf sabitinin ismi. Salt-okunur olup, yazılmaya çalışılırsa ReflectionException istisnası oluşur.

class

Sınıf sabitini tanımlandığı yerin ismi. Salt-okunur olup, yazılmaya çalışılırsa ReflectionException istisnası oluşur.

Öntanımlı Sabitler

ReflectionClassConstant Değiştiricileri

ReflectionClassConstant::IS_PUBLIC

Sabitin public olup olmadığını belirtir. PHP 7.4.0 öncesinde, bu değer 256 idi.

ReflectionClassConstant::IS_PROTECTED

Sabitin protected olup olmadığını belirtir. PHP 7.4.0 öncesinde, bu değer 512 idi.

ReflectionClassConstant::IS_PRIVATE

Sabitin private olup olmadığını belirtir. PHP 7.4.0 öncesinde, bu değer 1024 idi.

Bilginize:

Sabitlerin değerleri PHP sürümleri arasında farklılık gösterebilir. Bu bakımdan sabitler değerleriyle değil isimleriyle kullanılmalıdır.

İçindekiler

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top