PHPackages                             ocramius/instantiator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ocramius/instantiator

Abandoned → [doctrine/instantiator](/?search=doctrine%2Finstantiator)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

ocramius/instantiator
=====================

A small, lightweight utility to instantiate objects in PHP without invoking their constructors

1.1.4(11y ago)72430.7k8[1 issues](https://github.com/Ocramius/Instantiator/issues)1MITPHPPHP ~5.3

Since Jun 15Pushed 11y ago9 watchersCompare

[ Source](https://github.com/Ocramius/Instantiator)[ Packagist](https://packagist.org/packages/ocramius/instantiator)[ Docs](https://github.com/Ocramius/Instantiator)[ RSS](/packages/ocramius-instantiator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (1)

Instantiator
============

[](#instantiator)

This library provides a way of avoiding usage of constructors when instantiating PHP classes.

Deprecated in favour of [doctrine/instantiator](https://github.com/doctrine/instantiator)
-----------------------------------------------------------------------------------------

[](#deprecated-in-favour-of-doctrineinstantiator)

This library has been donated to the [doctrine organization](http://doctrine-project.org/) and has been renamed to [doctrine/instantiator](https://github.com/doctrine/instantiator). This repository/package is deprecated.

The library will still be maintained, but there won't be any new feature additions, and BC breaks will be refused, as no more future major versions are planned.

Bugs and security issues will still be fixed, and minor-, as well as patch- releases will be tagged if needed.

It is strongly suggested to use [doctrine/instantiator](https://github.com/doctrine/instantiator)instead.

Status
------

[](#status)

[![Build Status](https://camo.githubusercontent.com/9243c728f73831db71d0eb0ec2500af7ad4be8313ad0ff579fa8c813804eea33/68747470733a2f2f7472617669732d63692e6f72672f4f6372616d6975732f496e7374616e746961746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Ocramius/Instantiator)[![Code Coverage](https://camo.githubusercontent.com/df02526d05fbf22d8b7ce18f0c5a99bdea221887d1870a71061c21028db2e97c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f496e7374616e746961746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/Instantiator/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7eb8fce3db76bed7bcff39871a6a8784774779a7bed0be2e9b291ff5817ad55e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4f6372616d6975732f496e7374616e746961746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Ocramius/Instantiator/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/b3fa998e9501b810b5dc1c0cd7440048b90525e83222ffb91f5d4446672e4e3a/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37613263316364312d353139372d343832322d386134632d3564646163613438633736392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7a2c1cd1-5197-4822-8a4c-5ddaca48c769)[![Dependency Status](https://camo.githubusercontent.com/a691801ed0eebcc0cb622912060dde33f2a84585ff3e23be564ee01a8405024a/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7061636b6167652f7068702d2d6f6372616d6975732d2d696e7374616e746961746f722f62616467652e737667)](https://www.versioneye.com/package/php--ocramius--instantiator)[![HHVM Status](https://camo.githubusercontent.com/f6e9ae7917deafe86188137176c5829da145822d8f2fc7b53ab4f7eb1f4d6891/687474703a2f2f6868766d2e683463632e64652f62616467652f6f6372616d6975732f696e7374616e746961746f722e706e67)](http://hhvm.h4cc.de/package/ocramius/instantiator)

[![Latest Stable Version](https://camo.githubusercontent.com/f33778e811d5e473cbc0203b0f7a8ebf1219b03208667ce8f7151f983d92ba3b/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f696e7374616e746961746f722f762f737461626c652e706e67)](https://packagist.org/packages/ocramius/instantiator)[![Latest Unstable Version](https://camo.githubusercontent.com/32bd53820178ae17724feac194b9ad1b59cad6021c92be2369c75eba338008c2/68747470733a2f2f706f7365722e707567782e6f72672f6f6372616d6975732f696e7374616e746961746f722f762f756e737461626c652e706e67)](https://packagist.org/packages/ocramius/instantiator)

Installation
------------

[](#installation)

The suggested installation method is via [composer](https://getcomposer.org/):

```
php composer.phar require ocramius/instantiator:1.1.*
```

Usage
-----

[](#usage)

The instantiator is able to create new instances of any class without using the constructor of the class itself:

```
$instantiator = new \Instantiator\Instantiator();

$instance = $instantiator->instantiate('My\\ClassName\\Here');
```

Contributing
------------

[](#contributing)

Please read the [CONTRIBUTING.md](CONTRIBUTING.md) contents if you wish to help out!

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 99.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Recently: every ~13 days

Total

6

Last Release

4244d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd0445bc21fa116c259b5889377b90cbd8a34d49357321f76a74f6d2c2ae6b0c?d=identicon)[Ocramius](/maintainers/Ocramius)

---

Top Contributors

[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (161 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")

---

Tags

constructorinstantiate

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ocramius-instantiator/health.svg)

```
[![Health](https://phpackages.com/badges/ocramius-instantiator/health.svg)](https://phpackages.com/packages/ocramius-instantiator)
```

###  Alternatives

[doctrine/instantiator

A small, lightweight utility to instantiate objects in PHP without invoking their constructors

11.0k853.3M335](/packages/doctrine-instantiator)[symfony/var-exporter

Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects

2.1k378.1M441](/packages/symfony-var-exporter)[eventsauce/object-hydrator

Converts structured data into strict objects.

3322.3M20](/packages/eventsauce-object-hydrator)[nikolaposa/cascader

Utility for creating objects in PHP from constructor parameters definitions.

12237.5k3](/packages/nikolaposa-cascader)[precore/precore

Common classes and utilities

1427.8k](/packages/precore-precore)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
