PHP code example of sokumar2 / collections

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

    

sokumar2 / collections example snippets


$listFactory = new LinkedListFactory();

$linkedList = $listFactory->createInstance();

class ListServiceProvider extends ServiceProvider implements DeferrableProvider
{
    public function register(): void
    {
        $this->app->bind(ListInterface::class, LinkedList::class);
    }

    public function provides(): array
    {
        return [
            ListInterface::class
        ];
    }
}