Download the PHP package tonix-tuft/linked-hash-map without Composer

On this page you can find all versions of the php package tonix-tuft/linked-hash-map. 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 linked-hash-map

linked-hash-map

How I would implement a linked hash map in PHP if PHP wouldn't have associative arrays.

Installation

Using Composer:

Usage

This map implements the ArrayAccess interface as well as the Iterator and Countable interfaces and therefore can be used as a built-in PHP array:

Using any PHP data type for the key

This map allows using any PHP type for the key (i.e. even an array or an object can be used for the key):

Differences and similarities between this map and built-in PHP arrays

The differences between this map and built-in PHP arrays as well as any similarities are the following:

  1. Any PHP data type can be used for the key (bool, int, float/double, string, array, object, callable, iterable, resource) when using this map. This also means that for example a float/double 1.5 will be used for the key as-is, whereas in built-in PHP arrays 1.5 is type-juggled to 1:

  2. This map allows prepending instead of appending when setting the LinkedHashMap::INSERT_MODE_PREPEND flag (using the setInsertMode method):

  3. This map also allows setting the loop order (iteration) order (using the setLoopOrder method), whether normal (LinkedHashMap::LOOP_ORDER_NORMAL, the default) or reversed (LinkedHashMap::LOOP_ORDER_REVERSE):

  4. Appending/prepending to the map works in the same way as with built-in PHP arrays (a positional index (an int or integer string >= 0) is created or the highest positional index used so far is incremented internally). Accessing an unknown index does not trigger/emit a notice (just returns NULL):

  5. Because ArrayAccess::offsetSet doesn't allow to differentiate between NULL and an append/prepend operation ($map[] = 'A value'), NULL cannot be used for the key. Using NULL for the key will be considered as an append/prepend operation. As built-in PHP arrays map NULL to an empty string '', this shouldn't be an issue:

Using a custom hash code

Internally, the map computes the hash for the given key in order to retrieve the corresponding value using the package int-hash. If the key is an instance of a class implementing the LinkedHashMap\HashCodeInterface interface, its hashCode method will be called and the returned hash code (an integer) will be used instead:

License

MIT © Anton Bagdatyev (Tonix)


All versions of linked-hash-map with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
tonix-tuft/int-hash Version ^1.0
tonix-tuft/php-utils Version ^1.15
tonix-tuft/php-declarative-factory Version ^1.3
tonix-tuft/fun Version ^1.3
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 tonix-tuft/linked-hash-map contains the following files

Loading the files please wait ....