PHP code example of org_heigl / trait-iterator

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

    

org_heigl / trait-iterator example snippets


use Org_Heigl\IteratorTrait\IteratorTrait;

class MyList implements \Iterator
{
    use IteratorTrait;

    /** Can be an array or an Object implementing traversable */
    protected $yourArrayToIterateOver = [];

    public function & getIterableElement()
    {
        return $yourArrayToIterateOver
    }
}