CakeFest 2024: The Official CakePHP Conference

ReflectionClass::getModifiers

(PHP 5, PHP 7, PHP 8)

ReflectionClass::getModifiersSınıf değiştiricilerini döndürür

Açıklama

public ReflectionClass::getModifiers(): int

Sınıfın erişim değiştiricilerinin bit maskesini döndürür.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Değiştici sabitlerinin bit maskesini döndürür.

Ayrıca Bakınız

add a note

User Contributed Notes 1 note

up
-12
Nicola Pietroluongo
9 years ago
It's the amount of memory allocation in bit.
By default many systems allocate 1048576 bit (1 Megabit).

/* Example 1 */

class Test {}
$classTest = new Test();
$reflectionClass = new \ReflectionClass('Test');
$classModifiers = $reflectionClass->getModifiers();
var_export($classModifiers);

//output
1048576

/* Example 2 */

class Test {}
//the constructor is missing
$reflectionClass = new \ReflectionClass('Test');
$classModifiers = $reflectionClass->getModifiers();
var_export($classModifiers);

//output
0
To Top