PHP code example of fabrizio / map-php

1. Go to this page and download the library: Download fabrizio/map-php 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/ */

    

fabrizio / map-php example snippets




use Fabrizio\Map\Map;

// create map
$map = new Map(xClass::class, OtherClass::class);

$xclass = new xClass();
$oclass = new OtherClass();

// put key & value
$map->put($xclass,$oclass);

// get value using key
var_dump($map->get($xclass));