ReflectionClass::getProperty

(PHP 5, PHP 7)

ReflectionClass::getProperty锟斤拷取锟斤拷锟揭伙拷锟斤拷锟斤拷缘锟� ReflectionProperty

说锟斤拷

public ReflectionClass::getProperty ( string $name ) : ReflectionProperty

锟斤拷取锟斤拷锟揭伙拷锟斤拷锟斤拷缘锟� ReflectionProperty锟斤拷

锟斤拷锟斤拷

name

锟斤拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

一锟斤拷 ReflectionProperty锟斤拷

锟斤拷锟斤拷

Example #1 ReflectionClass::getProperty() 锟侥伙拷锟斤拷锟矫凤拷

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

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

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

锟轿硷拷