sebastian/object-reflector
Reflect object properties across a class hierarchy, including inherited, private, and protected members. sebastian/object-reflector provides a small utility for accessing and inspecting object state when PHP’s standard reflection APIs are inconvenient.
Adopt when:
Avoid when:
ReflectionClass suffices)ReflectionProperty::setValue() for writes)"This lightweight, battle-tested package solves a specific but critical need: safely inspecting private and protected object states during testing and debugging—without compromising encapsulation. Used in PHPUnit and other major PHP projects, it eliminates the risk and maintenance burden of building custom reflection logic. For engineering, it accelerates test development and reduces flaky assertions; for executives, it minimizes debugging time and accelerates release quality. Installation is trivial via Composer, and it’s strictly a dev/test tool—no production performance impact. We only adopt it where absolutely necessary, avoiding unnecessary complexity."
How can I help you explore Laravel packages today?