mtchabok/container_light

A lightweight, fast, and flexible container for managing resources (values, functions, objects, etc.)

0.4.0 2025-09-09 10:36 UTC

This package is auto-updated.

Last update: 2025-09-09 10:37:23 UTC


README

A lightweight, fast, and flexible container for managing resources (values, functions, objects, etc.)

Installation

Use the package manager composer to install mtchabok container light.

composer require mtchabok/container_light

Usage

$container = new \MCL\Container();
$container->bind(function(){ return "\nHello World!"; }, 'test');
$container->bind(fn() => "\nHow Are You?", 'test2');
$container->bind("\nI`m Fine!", 'test3');

echo $container->call('test');
echo $container->get('test1', "\ndefault value");
echo $container->test2();
echo $container->test3;