<?php class Foo { public int $id; } $foo = new Foo(); $reflectionClass = new ReflectionClass('Foo'); $prop = $reflectionClass->getProperty('id'); $prop->setValue($foo, '123'); var_dump($foo);
You have javascript disabled. You will not be able to edit any code.