PHPackages                             highperapp/container - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. highperapp/container

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

highperapp/container
====================

High-performance PSR-11 container

1.0(10mo ago)061MITPHPPHP ^8.3|^8.4

Since Jul 6Pushed 10mo agoCompare

[ Source](https://github.com/highperapp/container)[ Packagist](https://packagist.org/packages/highperapp/container)[ Docs](https://github.com/highperapp/container)[ RSS](/packages/highperapp-container/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (2)Used By (1)

HighPer DI Container
====================

[](#highper-di-container)

[![PHP Version](https://camo.githubusercontent.com/89899a77bdce65fc4c3d3423dfacff9c6461066a0b5354dc18d7721c23ba596e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d626c75652e737667)](https://php.net)[![PSR-11](https://camo.githubusercontent.com/19337495e4acc8ce11c3063531f214030e9c9027b9290017185c15a37147e23c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d31312d436f6d70617469626c652d677265656e2e737667)](https://www.php-fig.org/psr/psr-11/)[![Performance](https://camo.githubusercontent.com/2de02082add4ae41cd2099d2d1e9a4f41c4889045bc3c2a0e92dc63a4f4ebfde/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506572666f726d616e63652d4275696c642d2d54696d652d6f72616e67652e737667)](https://github.com/highperapp/di-container)[![Tests](https://camo.githubusercontent.com/8578f1392f0d3c5aaff254a5d341a08ecceb1ce654347d545e042a001a398a5f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54657374732d3130302532352d737563636573732e737667)](https://github.com/highperapp/di-container)

**Standalone high-performance PSR-11 container for any PHP project. Can be used independently or integrated with HighPer framework. Features object pooling, memory optimization, and zero-overhead service resolution.**

🚀 **Features**
--------------

[](#-features)

### ⚡ **Build-Time Compilation**

[](#-build-time-compilation)

- **ContainerCompiler**: Compile service definitions to optimized PHP code
- **O(1) Resolution**: Zero-overhead service lookups in production
- **Dependency Analysis**: Compile-time dependency validation
- **Cache Generation**: Persistent compiled container caching

### 🎯 **Performance Optimizations**

[](#-performance-optimizations)

- **PSR-11 Compatible**: Fully compliant with PSR-11 Container Interface
- **Object Pooling**: Advanced object pool for memory optimization
- **C10M Ready**: Optimized for extreme concurrency scenarios
- **Auto-wiring**: Lightning-fast automatic dependency injection
- **Memory Efficient**: Real-time memory usage tracking and optimization
- **Framework Agnostic**: Works standalone or integrates seamlessly with any framework
- **HighPer Framework**: First-class integration with HighPer framework

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

[](#installation)

```
composer require highperapp/container
```

Usage Scenarios
---------------

[](#usage-scenarios)

### 🔧 **Standalone Library**

[](#-standalone-library)

Use in any PHP project (Laravel, Symfony, CodeIgniter, or vanilla PHP):

```
// In any PHP project
use HighPerApp\HighPer\Container\Container;

$container = new Container();
$container->bind(DatabaseInterface::class, MySQLDatabase::class);
$database = $container->get(DatabaseInterface::class);
```

### 🏗️ **HighPer Framework Integration**

[](#️-highper-framework-integration)

Automatically available as the default container in HighPer framework with enhanced features and zero configuration.

Quick Start
-----------

[](#quick-start)

```
