Keep in mind that setValue won't work for readonly properties.
<?php
class Person
{
public function __construct(private readonly int $age) {}
}
$someOldPerson = new Person(80);
$reflection = new ReflectionProperty($someOldPerson, 'age');
$reflection->setValue($someOldPerson, 10); // Fatal error: Uncaught Error: Cannot modify readonly property Person::$age