PHP code example of bermudaphp / registry

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

    

bermudaphp / registry example snippets


Registry::set('message', 'Hello World');

Registry::getInstance()->offsetSet('message', 'Hello World!');
Registry::getInstance()['message'] = 'Hello, Jane!';


Registry::get('MessaGe', 'default value'); // default value

Registry::getInstance()->offsetGet('message'); // Hello, Jane!
Registry::getInstance()['message']; // Hello, Jane!;


Registry::has('appVersion'); // false

Registry::getInstance()->offsetExists('message'); // true
isset(Registry::getInstance()['message']); // true;


Registry::remove('message');

Registry::getInstance()->offsetUnset('message'); 
unset(Registry::getInstance()['message']);