2017 © Pedro Peláez
 

library tuple

An implementation of tuples in PHP.

image

p810/tuple

An implementation of tuples in PHP.

  • Friday, June 2, 2017
  • by p810
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

tuple

An implementation of tuples in PHP., (*1)

Installation

composer require p810/tuple --no-dev

Usage

<?php

use function p810\Tuple\tuple;

$tuple = tuple('foo', 'bar');

You can also use the Tag Space Unicode character (U+E0020) as a function to make it look like tuples do in Python. This is a proof of concept that I thought would be fun to add. Your coworkers probably won't think it's very fun though so please, weigh your options before using this., (*2)

$tuple = 󠀠('hello', 'world');
var_dump($tuple); // => p810\Tuple\Tuple#3 (2) {...}

Why?

This is a project I wanted to take on just because. I borrowed the idea from Python, which was my first introduction to the concept., (*3)

All in all, this utility is just a wrapper around a PHP object that implements ArrayAccess and restricts the ability to update, set, or remove items, which makes it immutable., (*4)

The Versions

02/06 2017

dev-master

9999999-dev

An implementation of tuples in PHP.

  Sources   Download

The Requires

  • php >= 7.0.0

 

The Development Requires

02/06 2017

1.0.0

1.0.0.0

An implementation of tuples in PHP.

  Sources   Download

The Requires

  • php >= 7.0.0

 

The Development Requires