instantiator (doctrine/instantiator)
Searching Database…
11K ·GitHub
What is this?
Doctrine Instantiator is a small PHP library that creates new instances of a class without calling its constructor or any other method on it.
Is it a library or a standalone tool?
It is a tiny PHP library meant to be required as a Composer dependency inside other projects, not a standalone application.
How do I add it to a project?
Install it with Composer, then call the instantiator's API to get a new instance of any class without invoking its constructor.
Do I need anything besides PHP and Composer?
No extra dependencies are listed; it only needs PHP and Composer to install.
Who typically uses this library?
It's mainly used by other libraries and frameworks (like Doctrine ORM and testing/mocking tools) that need to build objects while bypassing constructor logic.
Why would I want to skip a class's constructor?
This is useful for things like deserialization, mocking, or ORM hydration where you need an object instance before its constructor arguments are known.
Is this project actively maintained?
It is maintained under the Doctrine organization and has CI workflows for coding standards, static analysis, and benchmarks, suggesting active upkeep.
Was this always part of Doctrine?
No, it was migrated from the ocramius/instantiator package, which was donated to Doctrine and is now deprecated in favor of this one.
How big is this library?
It's a very small, single-purpose utility library with no runtime dependencies of its own.

