I am trying to perform a backup/restore function for static properties of classes. I can get a list of all of the static properties and their values using the reflection obj
For accessing private/protected properties of a class, using reflection, without the need for a ReflectionObject instance:
For static properties:
setAccessible(true);
$reflection->setValue(null, 'new property value');
For non-static properties:
setAccessible(true);
$reflection->setValue($instance, 'new property value');