ReflectionClass::setStaticPropertyValue
PHP Manual
PHP Manual»ReflectionClass»ReflectionClass::setStaticPropertyValue

ReflectionClass::setStaticPropertyValue

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

ReflectionClass::setStaticPropertyValue — Sets static property value

Descrizione

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.

Elenco dei parametri

name

Property name.

value

New property value.

Valori restituiti

Nessun valore viene restituito.

Log delle modifiche

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

Vedere anche:

To Top