PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

ReflectionClass::getStaticPropertyValue

(PHP 5 >= 5.1.0)

ReflectionClass::getStaticPropertyValueGets static property value

Description

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

Gets the value of a static property on this class.

Parameters

name

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

def_value

Return Values

The value of the static property.

Examples

Example #1 Basic usage of ReflectionClass::getStaticPropertyValue

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

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

The above example will output:

string(3) "Red"

See Also

PHP Manual