ReflectionClass
PHP Manual

ReflectionClass::getStaticPropertyValue

(PHP 5 >= 5.1.0)

ReflectionClass::getStaticPropertyValueGets static property value

Descrizione

public mixed ReflectionClass::getStaticPropertyValue ( string $name [, mixed &$def_value ] )

Gets the value of a static property on this class.

Elenco dei parametri

name

The name of the static property for which to return a value.

def_value

Valori restituiti

The value of the static property.

Esempi

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

<?php
class Apple {
    public static 
$color 'Red';
}

$class = new ReflectionClass('Apple');
var_dump($class->getStaticPropertyValue('color'));
?>

Il precedente esempio visualizzerĂ :

string(3) "Red"

Vedere anche:


ReflectionClass
PHP Manual