GoLang ReflectionClass::getProperty

request it (406)
GoLang replacement for PHP's ReflectionClass::getProperty [edit | history]



Do you know a GoLang replacement for PHP's ReflectionClass::getProperty? Write it!

PHP ReflectionClass::getProperty

PHP original manual for ReflectionClass::getProperty [ show | php.net ]

ReflectionClass::getProperty

(PHP 5, PHP 7)

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

Description

public ReflectionProperty ReflectionClass::getProperty ( string $name )

Gets a ReflectionProperty for a class's property.

Parameters

name

The property name.

Return Values

A ReflectionProperty.

Examples

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

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

The above example will output:

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

See Also