teds

pecl install teds

Provides extra data structures and iterable/array functionality.

teds (Tentative Extra Data Structures) is a collection of data structures and iterable functionality

Maintainer

  • Tyson Andre (lead )

Details

Stars: 28
Issue openned: 46
Downloads: 4225
0.5.1
2 years ago
Download DLL for processor with 64 bits architecture (x64)
PHP 8.1
Loading...
PHP 8.0
Loading...
Download DLL for processor with 32 bits architecture (x86)
PHP 8.1
Loading...
PHP 8.0
Loading...
Request a build
Request to the website owner's team the built this extension with this parameters. The result is not guaranteed and can be impossible for many reasons. The extension source code is frequently not upto date with the most recent PHP version.
If you have another code source for this extension, provide it in comment.
Please (or register) to request a build.
Version 0.5.1 change log


* Add Teds\array_value_first(), Teds\array_value_last()
* Add `Teds\stable_compare($v1, $v2): int` for a stable comparison function of arbitrary values. (see tests/misc/stable_compare.phpt).
Like strcmp, this returns a negative value for less than, and positive for greater than, and 0 for equality.
Note that php's `<` operator is not stable. `'10' < '0a' < '1b' < '9' < '10'`.
stable_compare fixes that by strictly ordering:
`null < false < true < int,float < string < array < object < resource`.
(objects and resources are compared by id, and arrays are compared recursively. Numbers are compared numerically. If an int is equal to a float, then the int is first)
(strings use strcmp)
* Make Deque iteration account for calls to shift/unshift tracking the position of the front of the Deque.
Calls to shift/unshift will do the following:
- Increase/Decrease the value returned by the iterator's key() by the number of elements added/removed to/from the front of the Deque. (`$deque[$iteratorKey] === $iteratorValue` at the time the key and value are returned).
- Repeated calls to shift will cause valid() to return false if the iterator's position ends up before the start of the Deque at the time iteration resumes.
- They will not cause the remaining values to be iterated over more than once or skipped.

requires:

  • php >=8.0.0
  • pearinstaller >=1.10