Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ReflectionClass::resetAsLazyProxyReflectionClass::__toString>
^ReflectionClassLast updated: Mon, 26 Oct 2026

ReflectionClass::setStaticPropertyValue

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

ReflectionClass::setStaticPropertyValue — Sets static property value

Description

public function ReflectionClass::setStaticPropertyValue(string $name, mixed $value): void

Sets the value of a static property on this class, regardless of the property's visibility.

ReflectionProperty::setValue() can also be used to set the value of static properties.

Parameters

name

Property name.

value

New property value.

Return Values

No value is returned.

Changelog

Version Description
7.4.9, 8.0.0 ReflectionClass::setStaticPropertyValue() can now set private and protected static properties. Previously, a ReflectionException was thrown.

See Also


<ReflectionClass::resetAsLazyProxyReflectionClass::__toString>
^ReflectionClassLast updated: Mon, 26 Oct 2026