Skip to content

A fixed-length immutable list data structure for PHP.

License

Notifications You must be signed in to change notification settings

Scien-ide/Tuple

Repository files navigation

Tuple

An immutable list with a fixed-length whose elements are indexed by their offset in the list.

Installation

Install into your project using Composer:

$ composer require scienide/tuple

Requirements

  • PHP 7.4 or above

Example

use Tuple;

$tuple = new Tuple(5.0, 3, 'foo');

[$first, $second, $third] = $tuple->list();

foreach ($tuple as $offset => $value) {
    //
}

echo count($tuple);

echo $tuple[2];
3

foo

Testing

To run the unit tests:

$ composer test

Static Analysis

To run static code analysis:

$ composer analyze

About

A fixed-length immutable list data structure for PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages