awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com

PHP Dependency Injection Libraries

Ranking updated Jul 13, 2026

For a dependency injection container for PHP, the first results are symfony/dependency-injection (This is a comprehensive, PSR-11 compliant dependency injection container that provides robust support for autowiring, constructor injection, service configuration, and lazy loading, making it the industry standard for managing object lifecycles in PHP), php-di/php-di (This library is a comprehensive dependency injection container that fully supports PSR-11, autowiring, constructor injection, and lazy loading, making it a flagship tool for managing object lifecycles in PHP) and symfony/symfony (Symfony provides a highly robust, PSR-11 compliant dependency injection container that supports autowiring, constructor injection, and lazy loading, though it is a full-stack framework rather than a standalone library). thephpleague/container and rdlowrey/auryn round out the shortlist. Compare the match explanations and check the project documentation against your requirements.

We curate open-source GitHub repositories matching “best php dependency injection libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.

PHP Dependency Injection Libraries

Find the best repos with AI.We'll search the best matching repositories with AI.
  • symfony/dependency-injectionsymfony avatar

    symfony/dependency-injection

    4,166View on GitHub↗

    This project is a PHP dependency injection container and framework designed to centralize object construction and manage class dependencies. It serves as a service container and configuration registry that automates object lifecycles and manages references between services to decouple application components from their specific dependencies. The system handles the instantiation and wiring of objects through both constructor and setter injection. It provides a centralized registry for storing reusable parameters and service definitions, which prevents the hardcoding of settings across the appli

    This is a comprehensive, PSR-11 compliant dependency injection container that provides robust support for autowiring, constructor injection, service configuration, and lazy loading, making it the industry standard for managing object lifecycles in PHP.

    PHPConstructor-Based InjectionsDependency Injection ContainersDependency Injection Containers
    View on GitHub↗4,166
  • php-di/php-diPHP-DI avatar

    PHP-DI/PHP-DI

    2,773View on GitHub↗

    PHP-DI is an inversion of control container designed to manage object lifecycles and dependency resolution within PHP applications. It functions as a centralized registry that automates the wiring of components, allowing for the decoupling of services from their concrete implementations. The library distinguishes itself by utilizing reflection to inspect class constructor signatures, enabling automatic dependency injection without requiring manual configuration for standard scenarios. It supports recursive resolution of dependency graphs and provides mechanisms for lazy object instantiation,

    This library is a comprehensive dependency injection container that fully supports PSR-11, autowiring, constructor injection, and lazy loading, making it a flagship tool for managing object lifecycles in PHP.

    PHPAutomatic Constructor Injection
    View on GitHub↗2,773
  • symfony/symfonysymfony avatar

    symfony/symfony

    31,073View on GitHub↗

    Symfony is a full-stack web framework designed for building scalable and maintainable server-side applications. It provides a comprehensive collection of decoupled components that form a foundational architecture, centered on a robust dependency injection container and a configuration-driven routing engine. By organizing code into modular services, the framework ensures that application components remain testable and loosely coupled throughout the development lifecycle. The framework distinguishes itself through an event-driven kernel architecture that allows developers to intercept and modif

    Symfony provides a highly robust, PSR-11 compliant dependency injection container that supports autowiring, constructor injection, and lazy loading, though it is a full-stack framework rather than a standalone library.

    PHPDependency Injection Containers
    View on GitHub↗31,073
  • thephpleague/containerthephpleague avatar

    thephpleague/container

    867View on GitHub↗

    Small but powerful dependency injection container

    This library provides a PSR-11 compliant dependency injection container that supports autowiring, constructor injection, and service configuration, making it a direct fit for managing object lifecycles in PHP applications.

    PHPDependency Injection
    View on GitHub↗867
  • rdlowrey/aurynrdlowrey avatar

    rdlowrey/Auryn

    724View on GitHub↗

    IoC Dependency Injector

    Auryn is a powerful dependency injection container that supports constructor injection, autowiring, and lazy loading, though it lacks native PSR-11 compliance.

    PHPDependency Injection
    View on GitHub↗724
  • php-fig/containerphp-fig avatar

    php-fig/container

    10,012View on GitHub↗

    This project is a shared technical specification and standard interface for dependency injection containers in PHP. It defines a common set of interfaces for retrieving services and dependencies, ensuring that different container implementations remain interoperable across the PHP ecosystem. By establishing a standardized API for dependency retrieval, the project allows developers to create libraries that function with any compliant container. This prevents vendor lock-in and enables different container implementations to be swapped without requiring changes to the application code. The spec

    This repository provides the PSR-11 interface specification for dependency injection containers rather than an implementation that provides features like autowiring or service configuration.

    PHPDependency Injection Containers
    View on GitHub↗10,012
  • symfony/routingsymfony avatar

    symfony/routing

    7,618View on GitHub↗

    This PHP routing library is an HTTP request router and matcher designed to map incoming URL paths to specific controller actions using defined patterns and configuration. It serves as a programmatic interface for defining, loading, and resolving URL patterns, while providing a URL generator to produce absolute or relative URIs from route names and parameters. The system supports diverse route loading through YAML, XML, PHP arrays, and class attributes, utilizing compiled route matching to optimize performance. It enables sophisticated request handling through regex-based path matching, sub-do

    This is a routing component for mapping URLs to controllers, which is a different functional domain than a dependency injection container for managing object lifecycles.

    PHPDependency AutowiringAutomatic Dependency Resolution
    View on GitHub↗7,618
  • laravel/frameworklaravel avatar

    laravel/framework

    34,774View on GitHub↗

    This project is a full-stack web framework that provides a comprehensive environment for building server-side applications. It utilizes a model-view-controller architecture to separate application logic into distinct layers for data management, user interface presentation, and request handling. The platform manages the entire request-response lifecycle, including security, session handling, and background task processing, while using an object-relational mapping layer to translate database records into programmable objects. The framework distinguishes itself through a central service containe

    While this framework includes a powerful dependency injection container, it is a full-stack web application platform rather than a standalone library for managing object lifecycles.

    PHPDependency Injection Containers
    View on GitHub↗34,774
Compare the top 10 at a glance
RepositoryStarsLanguageLicenseLast push
symfony/dependency-injection4.2KPHPMITJun 16, 2026
php-di/php-di2.8KPHPMITDec 31, 2025
symfony/symfony31.1KPHPMITJun 16, 2026
thephpleague/container867PHPMITMar 20, 2026
rdlowrey/auryn724PHPMITMar 2, 2025
php-fig/container10KPHPMITFeb 2, 2026
symfony/routing7.6KPHPMITJun 5, 2026
laravel/framework34.8KPHPMITJun 16, 2026

Related searches

  • a dependency injection container for Python
  • a dependency injection library for TypeScript
  • a dependency injection framework for Java
  • a dependency injection library for C#
  • a dependency injection toolkit for Go services
  • a modern web framework for PHP development
  • a library for building PHP CLI applications
  • a php library for application logging