ReflectionClass::getProperty

(PHP 5, PHP 7, PHP 8)

ReflectionClass::getPropertyBir sınıf özelliği için bir ReflectionProperty döndürür

Açıklama

publicReflectionClass::getProperty(string$isim): ReflectionProperty

Bir sınıf özelliği için bir ReflectionProperty döndürür.

Bağımsız Değişkenler

isim

Özelliğin ismi.

Dönen Değerler

Bir ReflectionProperty nesnesi.

Örnekler

Örnek 1 - ReflectionClass::getProperty() örneği

<?php
$class
= new ReflectionClass('ReflectionClass');
$property = $class->getProperty('name');
var_dump($property);
?>

Yukarıdaki örneğin çıktısı:

object(ReflectionProperty)#2 (2) { ["name"]=> string(4) "name" ["class"]=> string(15) "ReflectionClass" }

Ayrıca Bakınız

To Top