2017 © Pedro Peláez
 

library sequence

Lazy sequence library for PHP.

image

dkulyk/sequence

Lazy sequence library for PHP.

  • Tuesday, May 23, 2017
  • by lnkvisitor
  • Repository
  • 1 Watchers
  • 0 Stars
  • 68 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 51 % Grown

The README.md

Sequence

Quick Example

Install the package via composer by adding this section to the composer.json file:, (*1)

"require": {
    "dkulyk/sequence": "~1.0"
},

This is a tiny script to get a feeling of how Sequence works., (*2)

<?php
require_once __DIR__.'/vendor/autoload.php';

use DKulyk\Sequence\Sequence;

function fibonacci(&$value, $a = 1, $b = 2)
{
    $value = $a;
    return function (&$v) use ($a, $b) {
        return fibonacci($v, $b, $a + $b);
    };
}


$i = (new Sequence('fibonacci'))
    ->limit(10);

foreach ($i as $k => $v) {
    echo $k, ' => ', $v, PHP_EOL;
}

and the output of this program will be:, (*3)

0 => 1
1 => 2
2 => 3
3 => 5
4 => 8
5 => 13
6 => 21
7 => 34
8 => 55
9 => 89

This is just a tiny bit of all the things that can be accomplished with Sequence., (*4)

The Versions

23/05 2017

dev-master

9999999-dev

Lazy sequence library for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Kulyk Dmytro

23/05 2017

1.0.4

1.0.4.0

Lazy sequence library for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Kulyk Dmytro

10/02 2017

1.0.3

1.0.3.0

Lazy sequence library for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Kulyk Dmytro

10/02 2017

1.0.2

1.0.2.0

Lazy sequence library for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Kulyk Dmytro

10/02 2017

1.0.1

1.0.1.0

Lazy sequence library for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Kulyk Dmytro

10/02 2017

1.0.0

1.0.0.0

Lazy sequence library for PHP.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Kulyk Dmytro