PHP code example of henrik / container

1. Go to this page and download the library: Download henrik/container library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

henrik / container example snippets



use Henrik\Container\Container;use Henrik\Container\ContainerModes;

$container = new Container();

$container->set('x',new stdClass());
$container->changeMode(ContainerModes::MULTIPLE_VALUE_MODE);

var_dump($container->get('x'));