# ReflectionClass::setStaticPropertyValue

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

ReflectionClass::setStaticPropertyValue — Sets public static property value

### Beschreibung

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

Sets the value of a public static property. If the property is private or protected, the method will fail.

ReflectionProperty::setValue() allows setting the value of public, private, and protected properties.

### Parameter-Liste

`name`

  Property name.

`value`

  New property value.

### Rückgabewerte

Es wird kein Wert zurückgegeben.

### Changelog

Version | Beschreibung
--- | ---
7.4.0 | Using ReflectionClass::setStaticPropertyValue() to set a private or protected property now results in a fatal error. Previously, it threw a ReflectionException.

### Siehe auch

- ReflectionClass::getStaticPropertyValue() - Gets static property value
- ReflectionProperty::setValue() - Set property value

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open