Download the PHP package ft/sets without Composer

On this page you can find all versions of the php package ft/sets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sets

PHP lightweight hashtable (associative array) wrapper for Set data structures.

Sets are effectively containers that hold unique values.

Excogitation

What is 'unique'?

Unique is determined by this package via a hashed value for any given input. The hash value is generated internally for continuity. The hashed value is then used as a way to identify a hashtables element/value

Why create an internal hash code? Why not use built-in spl_object_hash or hash

There are many reasons why not to rely on these values, but fundamentally, they don't guarantee uniqueness.

Take for example:

The two objects are considered equal because they have the same amount of properties, the properties value's are identical and they both are derived stdClass objects.

However, the result of the 2 hashes:

Additionally spl_object_hash only allows objects and hash|md5 etc expect strings, not all objects include __toString() logic.

In short, this is a very complex problem to solve because uniqueness is never not guaranteed, but the hash can and should limit potential collisions which the package strives for

Installation

composer require ft/sets

Set Classes

Set

A container that can hold zero to many elements of any data type

Class Diagram

StrictSet

A subclass of Set, which only permits the same data type to exist in a given instance

Note The first element added to a StrictSet dictates what type of elements can be added subsequently

When a StrictSet element is added that is not the same type an InvalidArgumentException will be thrown. Subclasses of an element are not even permitted

SortedSet

A sorted set is one which the values are sorted in ascending order, or descending if elected. Therefore sorted sets must contain the same elements (a la StrictSet)

Additional functions are provided for numerical data types

Warning There is no locale integration for string comparisons, that's beyond the scope of this library

Class Diagram

Examples

Set

SortedSet


All versions of sets with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ft/reflection Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ft/sets contains the following files

Loading the files please wait ....