downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ReflectionClass::getShortName> <ReflectionClass::getProperties
[edit] Last updated: Fri, 14 Jun 2013

view this page in

ReflectionClass::getProperty

(PHP 5)

ReflectionClass::getPropertyGets a ReflectionProperty for a class's property

Descrição

public ReflectionProperty ReflectionClass::getProperty ( string $name )

Gets a ReflectionProperty for a class's property.

Parâmetros

name

The property name.

Valor Retornado

A ReflectionProperty.

Exemplos

Exemplo #1 Basic usage of ReflectionClass::getProperty()

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

O exemplo acima irá imprimir:

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

Veja Também



add a note add a note User Contributed Notes ReflectionClass::getProperty - [1 notes]
up
1
eric at naeseth dot com
1 year ago
If the class doesn't have a property with the given name, a ReflectionException will be raised.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites