, (*1)
, (*2)
đ Arrayy
A PHP array manipulation library. Compatible with PHP 7+ & PHP 8+, (*3)
``` php
\Arrayy\Type\StringCollection::create(['Array', 'Array'])->unique()->append('y')->implode() // Arrayy, (*4)
![Ed8ypbzWAAIinwv-1](https://user-images.githubusercontent.com/264695/183588620-3f1c2c32-e4aa-4069-9d12-23265689ba0b.jpeg)
* [Installation](#installation-via-composer-require)
* [Multidimensional ArrayAccess](#multidimensional-arrayaccess)
* [PhpDoc @property checking](#phpdoc-property-checking)
* [OO and Chaining](#oo-and-chaining)
* [Collections](#collections)
* [Pre-Defined Typified Collections](#pre-defined-typified-collections)
* [Convert JSON-Data into Collections](#convert-json-data-into-objects-collection)
* [Class methods](#class-methods)
* [use a "default object"](#use-a-default-object)
* [create](#createarray-array--arrayy-immutable)
* [createByReference](#createbyreferencearray-array--arrayy-mutable)
* [createFromJson](#createfromjsonstring-json--arrayy-immutable)
* [createFromJsonMapper](#createfromjsonmapperstring-json--arrayy-immutable)
* [createFromObject](#createfromobjectarrayaccess-object--arrayy-immutable)
* [createFromObjectVars](#createfromobjectvarsobject-object--arrayy-immutable)
* [createWithRange](#createwithrange--arrayy-immutable)
* [createFromGeneratorImmutable](#createfromgeneratorimmutable--arrayy-immutable)
* [createFromGeneratorFunction](#createfromgeneratorfunction--arrayy-immutable)
* [createFromString](#createfromstringstring-str--arrayy-immutable)
* [Instance methods](#instance-methods)
* ["set an array value"](#set-an-array-value)
* ["set an array value via dot-notation"](#setmixed-key-mixed-value--arrayy-immutable)
* ["get an array value"](#get-an-array-value)
* ["get an array value via dot-notation"](#getstring-key-null-default-null-array--mixed)
* ["get the array"](#get-the-array)
* ["delete an array value"](#delete-an-array-value)
* ["check if an array value is-set"](#check-if-an-array-value-is-set)
* ["simple loop with an Arrayy-object"](#simple-loop-with-an-arrayy-object)
* [overview](#arrayy-methods)
* [Tests](#tests)
* [License](#license)
## Installation via "composer require"
```shell
composer require voku/arrayy
Multidimensional ArrayAccess
You can access / change the array via Object, Array or with "Arrayy"-syntax., (*5)
Access via "Arrayy"-syntax: (dot-notation)
$arrayy = new A(['Lars' => ['lastname' => 'Moelleken']]);
$arrayy->get('Lars'); // ['lastname' => 'Moelleken']
$arrayy->get('Lars.lastname'); // 'Moelleken'
Access via "array"-syntax:
$arrayy = new A(['Lars' => ['lastname' => 'Moelleken']]);
$arrayy['Lars']; // ['lastname' => 'Moelleken']
$arrayy['Lars']['lastname']; // 'Moelleken'
Access via "object"-syntax:
$arrayy = new A(['Lars' => ['lastname' => 'Moelleken']]);
$arrayy->Lars; // Arrayy['lastname' => 'Moelleken']
$arrayy->Lars->lastname; // 'Moelleken'
Set values via "Arrayy"-syntax: (dot-notation)
$arrayy = new A(['Lars' => ['lastname' => 'Mueller']]);
$arrayy->set('Lars.lastname', 'Moelleken');
$arrayy->get('Lars.lastname'); // 'Moelleken'
Set values via "array"-syntax:
$arrayy = new A(['Lars' => ['lastname' => 'Moelleken']]);
$arrayy['Lars'] = array('lastname' => 'MĂźller');
$arrayy['Lars']['lastname']; // 'MĂźller'
Set values via "object"-syntax:
$arrayy = new A(['Lars' => ['lastname' => 'Moelleken']]);
$arrayy->Lars = array('lastname' => 'MĂźller');
$arrayy->Lars->lastname; // 'MĂźller'
PhpDoc @property checking
The library offers a type checking for @property phpdoc-class-comments, as seen below:, (*6)
/**
* @property int $id
* @property int|string $firstName
* @property string $lastName
* @property null|City $city
*
* @extends \Arrayy\Arrayy<array-key,mixed>
*/
class User extends \Arrayy\Arrayy
{
protected $checkPropertyTypes = true;
protected $checkPropertiesMismatchInConstructor = true;
}
/**
* @property string|null $plz
* @property string $name
* @property string[] $infos
*
* @extends \Arrayy\Arrayy<array-key,mixed>
*/
class City extends \Arrayy\Arrayy
{
protected $checkPropertyTypes = true;
protected $checkPropertiesMismatchInConstructor = true;
}
$cityMeta = City::meta();
$city = new City(
[
$cityMeta->plz => null,
$cityMeta->name => 'DĂźsseldorf',
$cityMeta->infos => ['lall'],
]
);
$userMeta = User::meta();
$user = new User(
[
$userMeta->id => 1,
$userMeta->firstName => 'Lars',
$userMeta->lastName => 'Moelleken',
$userMeta->city => $city,
]
);
var_dump($user['lastName']); // 'Moelleken'
var_dump($user[$userMeta->lastName]); // 'Moelleken'
var_dump($user->lastName); // Moelleken
var_dump($user['city.name']); // 'DĂźsseldorf'
var_dump($user[$userMeta->city][$cityMeta->name]); // 'DĂźsseldorf'
var_dump($user->city->name); // DĂźsseldorf
- "checkPropertyTypes": activate the type checking for all defined @property in the class-phpdoc
- "checkPropertiesMismatchInConstructor": activate the property mismatch check, so you can only add an
array with all needed properties (or an empty array) into the constructor
OO and Chaining
The library also offers OO method chaining, as seen below:, (*7)
simple example:, (*8)
echo a(['fòô', 'bĂ Ĺ', 'bĂ Ĺ'])->unique()->reverse()->implode(','); // 'bĂ Ĺ,fòô'
complex example:, (*9)
/**
* @property int $id
* @property string $firstName
* @property string $lastName
*
* @extends \Arrayy\Arrayy<array-key,mixed>
*/
class User extends \Arrayy\Arrayy
{
protected $checkPropertyTypes = true;
protected $checkPropertiesMismatchInConstructor = true;
}
/**
* @template TKey of array-key
* @extends AbstractCollection<TKey,User>
*/
class UserCollection extends \Arrayy\Collection\AbstractCollection
{
/**
* The type (FQCN) associated with this collection.
*
* @return string
*/
public function getType()
{
return User::class;
}
}
$m = User::meta();
$data = static function () use ($m) {
yield new User([$m->id => 40, $m->firstName => 'Foo', $m->lastName => 'Moelleken']);
yield new User([$m->id => 30, $m->firstName => 'Sven', $m->lastName => 'Moelleken']);
yield new User([$m->id => 20, $m->firstName => 'Lars', $m->lastName => 'Moelleken']);
yield new User([$m->id => 10, $m->firstName => 'Lea', $m->lastName => 'Moelleken']);
};
$users = UserCollection::createFromGeneratorFunction($data);
$names = $users
->filter(static function (User $user): bool {
return $user->id <= 30;
})
->customSortValuesImmutable(static function (User $a, User $b): int {
return $a->firstName <=> $b->firstName;
})
->map(static function (User $user): string {
return $user->firstName;
})
->implode(';');
static::assertSame('Lars;Lea;Sven', $names);
Implemented Interfaces
Arrayy\Arrayy
implements the IteratorAggregate
interface, meaning that
foreach
can be used with an instance of the class:, (*10)
``` php
$arrayy = a(['fòôbĂ Ĺ', 'foo']);
foreach ($arrayy as $value) {
echo $value;
}
// 'fòôbĂ Ĺ'
// 'foo', (*11)
It implements the `Countable` interface, enabling the use of `count()` to
retrieve the number of elements in the array:
``` php
$arrayy = a(['fòô', 'foo']);
count($arrayy); // 2
PHP 5.6 Creation
As of PHP 5.6, use function
is
available for importing functions. Arrayy exposes a namespaced function,
Arrayy\create
, which emits the same behaviour as Arrayy\Arrayy::create()
.
If running PHP 5.6, or another runtime that supports the use function
syntax,
you can take advantage of an even simpler API as seen below:, (*12)
``` php
use function Arrayy\create as a;, (*13)
// Instead of: A::create(['fòô', 'bĂ Ĺ'])->reverse()->implode();
a(['fòô', 'bĂ Ĺ'])->reverse()->implode(','); // 'bĂ Ĺ,fòô', (*14)
## Collections
If you need to group objects together, it's not a good idea
to use a simple array or Arrayy object. For these cases you can use the ```AbstractCollection```
class.
It will throw a ```InvalidArgumentException``` if you try to add a non valid object into the collection.
e.g.: "YOURCollection.php" (see example ```/tests/CollectionTest.php``` on github)
```php
use Arrayy\Collection\AbstractCollection;
/**
* @extends AbstractCollection<array-key,YOURInterface>
*/
class YOURCollection extends AbstractCollection
{
/**
* The type (FQCN) associated with this collection.
*
* @return string
*/
public function getType(): string
{
return YOURInterface::class;
}
}
$YOURobject1 = new YOURClass();
$YOURobject2 = new YOURClass();
$YOURcollection = new YOURCollection($YOURobject1);
$YOURcollection->add($YOURobject2); // add one more object
// Or, you can use an array of objects.
//
// $YOURcollection = new YOURCollection([$YOURobject1, $YOURobject2]);
// Or, if you don't want to create new classes ...
// ... and you don't need typehints and autocompletion via classes.
//
// $YOURcollection = \Arrayy\Collection::construct(YOURInterface::class, [$YOURobject1]);
// $YOURcollection->add($YOURobject2); // add one more object
// Or, if you don't like classes at all. ;-)
//
// $YOURcollection = \Arrayy\collection(YOURInterface::class, [$YOURobject1]);
// $YOURcollection->add($YOURobject2); // add one more object
foreach ($YOURcollection as $YOURobject) {
if ($YOURobject instanceof YOURInterface) {
// Do something with $YOURobject
}
}
You can also use "dot-notation" to get data from your collections e.g.
$YOURcollection->get('3123.foo.bar');
, (*15)
Pre-Defined Typified Collections
simple example
This will throw a "TypeError"-Exception., (*16)
use Arrayy\Type\StringCollection;
$collection = new StringCollection(['A', 'B', 'C', 1]);
complex example
This will NOT throw a "TypeError"-Exception., (*17)
use Arrayy\Type\IntCollection;
use Arrayy\Type\StringCollection;
use Arrayy\Type\InstancesCollection;
use Arrayy\Type\TypeInterface;
$collection = InstancesCollection::construct(
TypeInterface::class,
[new StringCollection(['A', 'B', 'C']), new IntCollection([1])]
);
$collection->toArray(true); // [['A', 'B', 'C'], [1]]
Convert JSON-Data into Objects (Collection)
namespace Arrayy\tests\Collection;
use Arrayy\Collection\AbstractCollection;
/**
* @extends AbstractCollection<array-key,\Arrayy\tests\UserData>
*/
class UserDataCollection extends AbstractCollection
{
/**
* The type (FQCN) associated with this collection.
*
* @return string
*/
public function getType()
{
return \Arrayy\tests\UserData::class;
}
}
$json = '[{"id":1,"firstName":"Lars","lastName":"Moelleken","city":{"name":"DĂźsseldorf","plz":null,"infos":["lall"]}}, {"id":1,"firstName":"Sven","lastName":"Moelleken","city":{"name":"KĂśln","plz":null,"infos":["foo"]}}]';
$userDataCollection = UserDataCollection::createFromJsonMapper($json);
/** @var \Arrayy\tests\UserData[] $userDatas */
$userDataCollection->getAll();
$userData0 = $userDataCollection[0];
echo $userData0->firstName; // 'Lars'
$userData0->city; // CityData::class
echo $userData0->city->name; // 'DĂźsseldorf'
$userData1 = $userDataCollection[1];
echo $userData1->firstName; // 'Sven'
$userData1->city; // CityData::class
echo $userData1->city->name; // 'KĂśln'
Class methods
use a "default object"
Creates an Arrayy object., (*18)
$arrayy = new Arrayy(array('fòô', 'bĂ Ĺ')); // Arrayy['fòô', 'bĂ Ĺ']
create(array $array) : Arrayy (Immutable)
Creates an Arrayy object, via static "create()"-method, (*19)
$arrayy = A::create(array('fòô', 'bĂ Ĺ')); // Arrayy['fòô', 'bĂ Ĺ']
createByReference(array &$array) : Arrayy (Mutable)
WARNING: Creates an Arrayy object by reference., (*20)
$array = array('fòô', 'bĂ Ĺ');
$arrayy = A::createByReference($array); // Arrayy['fòô', 'bĂ Ĺ']
createFromJson(string $json) : Arrayy (Immutable)
Create an new Arrayy object via JSON., (*21)
$str = '{"firstName":"John", "lastName":"Doe"}';
$arrayy = A::createFromJson($str); // Arrayy['firstName' => 'John', 'lastName' => 'Doe']
createFromJsonMapper(string $json) : Arrayy (Immutable)
Create an new Arrayy object via JSON and fill sub-objects is possible., (*22)
<?php
namespace Arrayy\tests;
/**
* @property int $id
* @property int|string $firstName
* @property string $lastName
* @property \Arrayy\tests\CityData|null $city
*
* @extends \Arrayy\Arrayy<array-key,mixed>
*/
class UserData extends \Arrayy\Arrayy
{
protected $checkPropertyTypes = true;
protected $checkForMissingPropertiesInConstructor = true;
}
/**
* @property string|null $plz
* @property string $name
* @property string[] $infos
*
* @extends \Arrayy\Arrayy<array-key,mixed>
*/
class CityData extends \Arrayy\Arrayy
{
protected $checkPropertyTypes = true;
protected $checkPropertiesMismatchInConstructor = true;
protected $checkForMissingPropertiesInConstructor = true;
protected $checkPropertiesMismatch = true;
}
$json = '{"id":1,"firstName":"Lars","lastName":"Moelleken","city":{"name":"DĂźsseldorf","plz":null,"infos":["lall"]}}';
$userData = UserData::createFromJsonMapper($json);
$userData; // => \Arrayy\tests\UserData::class
echo $userData->firstName; // 'Lars'
$userData->city; // => \Arrayy\tests\CityData::class
echo $userData->city->name; // 'DĂźsseldorf'
createFromObject(ArrayAccess $object) : Arrayy (Immutable)
Create an new instance filled with values from an object that have implemented ArrayAccess., (*23)
$object = A::create(1, 'foo');
$arrayy = A::createFromObject($object); // Arrayy[1, 'foo']
createFromObjectVars(\object $object) : Arrayy (Immutable)
Create an new instance filled with values from an object., (*24)
$object = new stdClass();
$object->x = 42;
$arrayy = A::createFromObjectVars($object); // Arrayy['x' => 42]
createWithRange() : Arrayy (Immutable)
Create an new instance containing a range of elements., (*25)
$arrayy = A::createWithRange(2, 4); // Arrayy[2, 3, 4]
createFromGeneratorImmutable() : Arrayy (Immutable)
Create an new instance filled with a copy of values from a "Generator"-object., (*26)
WARNING: Need more memory then the "A::createFromGeneratorFunction()" call, because we
will fetch and store all keys and values from the Generator., (*27)
$generator = A::createWithRange(2, 4)->getGenerator();
$arrayy = A::createFromGeneratorImmutable($generator); // Arrayy[2, 3, 4]
createFromGeneratorFunction() : Arrayy (Immutable)
Create an new instance from a callable function which will return a Generator., (*28)
$generatorFunction = static function() {
yield from A::createWithRange(2, 4)->getArray();
};
$arrayy = A::createFromGeneratorFunction($generatorFunction); // Arrayy[2, 3, 4]
createFromString(string $str) : Arrayy (Immutable)
Create an new Arrayy object via string., (*29)
$arrayy = A::createFromString(' foo, bar '); // Arrayy['foo', 'bar']
Instance Methods
Arrayy: All examples below make use of PHP 5.6
function importing, and PHP 5.4 short array syntax. For further details,
see the documentation for the create method above, as well as the notes
on PHP 5.6 creation., (*30)
"set an array value"
$arrayy = a(['fòô' => 'bĂ Ĺ']);
$arrayy['foo'] = 'bar';
var_dump($arrayy); // Arrayy['fòô' => 'bĂ Ĺ', 'foo' => 'bar']
"get an array value"
$arrayy = a(['fòô' => 'bĂ Ĺ']);
var_dump($arrayy['fòô']); // 'bĂ Ĺ'
"get the array"
$arrayy = a(['fòô' => 'bĂ Ĺ']);
var_dump($arrayy->getArray()); // ['fòô' => 'bĂ Ĺ']
"delete an array value"
$arrayy = a(['fòô' => 'bĂ Ĺ', 'lall']);
unset($arrayy['fòô']);
var_dump($arrayy); // Arrayy[0 => 'lall']
"check if an array value is-set"
$arrayy = a(['fòô' => 'bĂ Ĺ']);
isset($arrayy['fòô']); // true
"simple loop with an Arrayy-object"
$arrayy = a(['fòô' => 'bĂ Ĺ']);
foreach ($arrayy) as $key => $value) {
echo $key . ' | ' . $value; // fòô | bĂ Ĺ
}
Arrayy methods
, (*31)
add(mixed $value, int|string|null $key): static
â
Add new values (optional using dot-notation)., (*32)
Parameters:
- T $value
- TKey $key
, (*33)
Return:
- static <p>(Immutable) Return this Arrayy object, with the appended values.</p>
, (*34)
append(mixed $value, mixed $key): $this
â
Append a (key) + value to the current array., (*35)
EXAMPLE:
a(['fòô' => 'bĂ Ĺ'])->append('foo'); // Arrayy['fòô' => 'bĂ Ĺ', 0 => 'foo']
, (*36)
Parameters:
- T $value
- TKey|null $key
, (*37)
Return:
- $this <p>(Mutable) Return this Arrayy object, with the appended values.</p>
, (*38)
appendArrayValues(array $values, mixed $key): $this
â
Append a (key) + values to the current array., (*39)
EXAMPLE:
a(['fòô' => ['bĂ Ĺ']])->appendArrayValues(['foo1', 'foo2'], 'fòô'); // Arrayy['fòô' => ['bĂ Ĺ', 'foo1', 'foo2']]
, (*40)
Parameters:
- array<T> $values
- TKey|null $key
, (*41)
Return:
- $this <p>(Mutable) Return this Arrayy object, with the appended values.</p>
, (*42)
appendImmutable(mixed $value, mixed $key): $this
â
Append a (key) + value to the current array., (*43)
EXAMPLE:
a(['fòô' => 'bĂ Ĺ'])->appendImmutable('foo')->getArray(); // ['fòô' => 'bĂ Ĺ', 0 => 'foo']
, (*44)
Parameters:
- T $value
- TKey $key
, (*45)
Return:
- $this <p>(Immutable) Return this Arrayy object, with the appended values.</p>
, (*46)
appendToEachKey(int|string $prefix): static
â
Add a suffix to each key., (*47)
Parameters:
- int|string $prefix
, (*48)
Return:
- static <p>(Immutable) Return an Arrayy object, with the prefixed keys.</p>
, (*49)
appendToEachValue(float|int|string $prefix): static
â
Add a prefix to each value., (*50)
Parameters:
- float|int|string $prefix
, (*51)
Return:
- static <p>(Immutable) Return an Arrayy object, with the prefixed values.</p>
, (*52)
arsort(): $this
â
Sort an array in reverse order and maintain index association., (*53)
Parameters:
nothing, (*54)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*55)
arsortImmutable(): $this
â
Sort an array in reverse order and maintain index association., (*56)
Parameters:
nothing, (*57)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*58)
asort(int $sort_flags): $this
â
Sort the entries by value., (*59)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*60)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*61)
asortImmutable(int $sort_flags): $this
â
Sort the entries by value., (*62)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*63)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*64)
at(\Closure $closure): static
â
Iterate over the current array and execute a callback for each loop., (*65)
EXAMPLE:
$result = A::create();
$closure = function ($value, $key) use ($result) {
$result[$key] = ':' . $value . ':';
};
a(['foo', 'bar' => 'bis'])->at($closure); // Arrayy[':foo:', 'bar' => ':bis:']
, (*66)
Parameters:
- \Closure(T , TKey ): mixed $closure
, (*67)
Return:
- static <p>(Immutable)</p>
, (*68)
average(int $decimals): float|int
â
Returns the average value of the current array., (*69)
EXAMPLE:
a([-9, -8, -7, 1.32])->average(2); // -5.67
, (*70)
Parameters:
- int $decimals <p>The number of decimal-numbers to return.</p>
, (*71)
Return:
- float|int <p>The average value.</p>
, (*72)
changeKeyCase(int $case): static
â
Changes all keys in an array., (*73)
Parameters:
- int $case [optional] <p> Either <strong>CASE_UPPER</strong><br />
or <strong>CASE_LOWER</strong> (default)</p>
, (*74)
Return:
- static <p>(Immutable)</p>
, (*75)
changeSeparator(string $separator): $this
â
Change the path separator of the array wrapper., (*76)
By default, the separator is: ".", (*77)
Parameters:
- non-empty-string $separator <p>Separator to set.</p>
, (*78)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*79)
chunk(int $size, bool $preserveKeys): static|static[]
â
Create a chunked version of the current array., (*80)
EXAMPLE:
a([-9, -8, -7, 1.32])->chunk(2); // Arrayy[[-9, -8], [-7, 1.32]]
, (*81)
Parameters:
- int $size <p>Size of each chunk.</p>
- bool $preserveKeys <p>Whether array keys are preserved or no.</p>
, (*82)
Return:
- static|static[] <p>(Immutable) A new array of chunks from the original array.</p>
, (*83)
clean(): static
â
Clean all falsy values from the current array., (*84)
EXAMPLE:
a([-8 => -9, 1, 2 => false])->clean(); // Arrayy[-8 => -9, 1]
, (*85)
Parameters:
nothing, (*86)
Return:
- static <p>(Immutable)</p>
, (*87)
clear(int|int[]|string|string[]|null $key): $this
â
WARNING!!! -> Clear the current full array or a $key of it., (*88)
EXAMPLE:
a([-8 => -9, 1, 2 => false])->clear(); // Arrayy[]
, (*89)
Parameters:
- int|int[]|string|string[]|null $key
, (*90)
Return:
- $this <p>(Mutable) Return this Arrayy object, with an empty array.</p>
, (*91)
contains(float|int|string $value, bool $recursive, bool $strict): bool
â
Check if an item is in the current array., (*92)
EXAMPLE:
a([1, true])->contains(true); // true
, (*93)
Parameters:
- float|int|string $value
- bool $recursive
- bool $strict
, (*94)
Return:
- bool
, (*95)
containsCaseInsensitive(mixed $value, bool $recursive): bool
â
Check if an (case-insensitive) string is in the current array., (*96)
EXAMPLE:
a(['E', 'ĂŠ'])->containsCaseInsensitive('Ă'); // true
, (*97)
Parameters:
- mixed $value
- bool $recursive
, (*98)
Return:
- bool
, (*99)
containsKey(int|string $key): bool
â
Check if the given key/index exists in the array., (*100)
EXAMPLE:
a([1 => true])->containsKey(1); // true
, (*101)
Parameters:
- int|string $key <p>key/index to search for</p>
, (*102)
Return:
- bool <p>Returns true if the given key/index exists in the array, false otherwise.</p>
, (*103)
containsKeys(array $needles, bool $recursive): bool
â
Check if all given needles are present in the array as key/index., (*104)
EXAMPLE:
a([1 => true])->containsKeys(array(1 => 0)); // true
, (*105)
Parameters:
- array<TKey> $needles <p>The keys you are searching for.</p>
- bool $recursive
, (*106)
Return:
- bool <p>Returns true if all the given keys/indexes exists in the array, false otherwise.</p>
, (*107)
containsKeysRecursive(array $needles): bool
â
Check if all given needles are present in the array as key/index., (*108)
Parameters:
- array<TKey> $needles <p>The keys you are searching for.</p>
, (*109)
Return:
- bool <p>Returns true if all the given keys/indexes exists in the array, false otherwise.</p>
, (*110)
containsOnly(float|int|string $value, bool $recursive, bool $strict): bool
â
Check if an item is in the current array., (*111)
EXAMPLE:
a([1, true])->containsOnly(true); // false
, (*112)
Parameters:
- float|int|string $value
- bool $recursive
- bool $strict
, (*113)
Return:
- bool
, (*114)
containsValue(float|int|string $value): bool
â
alias: for "Arrayy->contains()", (*115)
Parameters:
- float|int|string $value
, (*116)
Return:
- bool
, (*117)
containsValueRecursive(float|int|string $value): bool
â
alias: for "Arrayy->contains($value, true)", (*118)
Parameters:
- float|int|string $value
, (*119)
Return:
- bool
, (*120)
containsValues(array $needles): bool
â
Check if all given needles are present in the array., (*121)
EXAMPLE:
a([1, true])->containsValues(array(1, true)); // true
, (*122)
Parameters:
- array<T> $needles
, (*123)
Return:
- bool <p>Returns true if all the given values exists in the array, false otherwise.</p>
, (*124)
count(int $mode): int
â
Counts all elements in an array, or something in an object., (*125)
EXAMPLE:
a([-9, -8, -7, 1.32])->count(); // 4
, (*126)
For objects, if you have SPL installed, you can hook into count() by implementing interface {@see \Countable}.
The interface has exactly one method, {@see \Countable::count()}, which returns the return value for the count()
function. Please see the {@see \Array} section of the manual for a detailed explanation of how arrays are
implemented and used in PHP.
, (*127)
Parameters:
- int $mode [optional] If the optional mode parameter is set to
COUNT_RECURSIVE (or 1), count
will recursively count the array. This is particularly useful for
counting all the elements of a multidimensional array. count does not detect infinite recursion.
, (*128)
Return:
- int <p>
The number of elements in var, which is
typically an array, since anything else will have one
element.
</p>
<p>
If var is not an array or an object with
implemented Countable interface,
1 will be returned.
There is one exception, if var is &null;,
0 will be returned.
</p>
<p>
Caution: count may return 0 for a variable that isn't set,
but it may also return 0 for a variable that has been initialized with an
empty array. Use isset to test if a variable is set.
</p>
, (*129)
countValues(): static
â
Counts all the values of an array, (*130)
Parameters:
nothing, (*131)
Return:
- static <p>
(Immutable)
An associative Arrayy-object of values from input as
keys and their count as value.
</p>
, (*132)
create(mixed $data, string $iteratorClass, bool $checkPropertiesInConstructor): static
â
Creates an Arrayy object., (*133)
Parameters:
- mixed $data
- class-string<\Arrayy\ArrayyIterator> $iteratorClass
- bool $checkPropertiesInConstructor
, (*134)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*135)
createByReference(array $array): $this
â
WARNING: Creates an Arrayy object by reference., (*136)
Parameters:
- array $array
, (*137)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*138)
createFromArray(array $array): static
â
Create an new Arrayy object via JSON., (*139)
Parameters:
- array $array
, (*140)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*141)
createFromGeneratorFunction(callable $generatorFunction): static
â
Create an new instance from a callable function which will return an Generator., (*142)
Parameters:
- callable(): \Generator<TKey, T> $generatorFunction
, (*143)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*144)
createFromGeneratorImmutable(\Generator $generator): static
â
Create an new instance filled with a copy of values from a "Generator"-object., (*145)
Parameters:
- \Generator<TKey, T> $generator
, (*146)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*147)
createFromJson(string $json): static
â
Create an new Arrayy object via JSON., (*148)
Parameters:
- string $json
, (*149)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*150)
createFromJsonMapper(string $json): static
â, (*151)
Parameters:
- string $json
, (*152)
Return:
- static <p>(Immutable)</p>
, (*153)
createFromObject(\Traversable $object): static
â
Create an new instance filled with values from an object that is iterable., (*154)
Parameters:
- \Traversable<array-key, T> $object <p>iterable object</p>
, (*155)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*156)
createFromObjectVars(object $object): static
â
Create an new instance filled with values from an object., (*157)
Parameters:
- object $object
, (*158)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*159)
createFromString(string $str, string|null $delimiter, string|null $regEx): static
â
Create an new Arrayy object via string., (*160)
Parameters:
- string $str <p>The input string.</p>
- non-empty-string|null $delimiter <p>The boundary string.</p>
- string|null $regEx <p>Use the $delimiter or the $regEx, so if $pattern is null, $delimiter will be
used.</p>
, (*161)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*162)
createFromTraversableImmutable(\Traversable $traversable, bool $use_keys): static
â
Create an new instance filled with a copy of values from a "Traversable"-object., (*163)
Parameters:
- \Traversable<(array-key|TKey), T> $traversable
- bool $use_keys [optional] <p>
Whether to use the iterator element keys as index.
</p>
, (*164)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*165)
createWithRange(float|int|string $low, float|int|string $high, float|int $step): static
â
Create an new instance containing a range of elements., (*166)
Parameters:
- float|int|string $low <p>First value of the sequence.</p>
- float|int|string $high <p>The sequence is ended upon reaching the end value.</p>
- float|int $step <p>Used as the increment between elements in the sequence.</p>
, (*167)
Return:
- static <p>(Immutable) Returns an new instance of the Arrayy object.</p>
, (*168)
current(): false|mixed
â
Gets the element of the array at the current internal iterator position., (*169)
Parameters:
nothing, (*170)
Return:
- false|mixed
, (*171)
customSortKeys(callable $callable): $this
â
Custom sort by index via "uksort"., (*172)
EXAMPLE:
$callable = function ($a, $b) {
if ($a == $b) {
return 0;
}
return ($a > $b) ? 1 : -1;
};
$arrayy = a(['three' => 3, 'one' => 1, 'two' => 2]);
$resultArrayy = $arrayy->customSortKeys($callable); // Arrayy['one' => 1, 'three' => 3, 'two' => 2]
, (*173)
Parameters:
- callable $callable
, (*174)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*175)
customSortKeysImmutable(callable $callable): $this
â
Custom sort by index via "uksort"., (*176)
Parameters:
- callable $callable
, (*177)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*178)
customSortValues(callable $callable): $this
â
Custom sort by value via "usort"., (*179)
EXAMPLE:
$callable = function ($a, $b) {
if ($a == $b) {
return 0;
}
return ($a > $b) ? 1 : -1;
};
$arrayy = a(['three' => 3, 'one' => 1, 'two' => 2]);
$resultArrayy = $arrayy->customSortValues($callable); // Arrayy[1, 2, 3]
, (*180)
Parameters:
- callable $callable
, (*181)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*182)
customSortValuesImmutable(callable $callable): $this
â
Custom sort by value via "usort"., (*183)
Parameters:
- callable $callable
, (*184)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*185)
delete(int|int[]|string|string[] $keyOrKeys): void
â
Delete the given key or keys., (*186)
Parameters:
- int|int[]|string|string[] $keyOrKeys
, (*187)
Return:
- void
, (*188)
diff(array $array): static
â
Return elements where the values that are only in the current array., (*189)
EXAMPLE:
a([1 => 1, 2 => 2])->diff([1 => 1]); // Arrayy[2 => 2]
, (*190)
Parameters:
- array ...$array
, (*191)
Return:
- static <p>(Immutable)</p>
, (*192)
diffKey(array $array): static
â
Return elements where the keys are only in the current array., (*193)
Parameters:
- array ...$array
, (*194)
Return:
- static <p>(Immutable)</p>
, (*195)
diffKeyAndValue(array $array): static
â
Return elements where the values and keys are only in the current array., (*196)
Parameters:
- array ...$array
, (*197)
Return:
- static <p>(Immutable)</p>
, (*198)
diffRecursive(array $array, array|\Generator|null $helperVariableForRecursion): static
â
Return elements where the values are only in the current multi-dimensional array., (*199)
EXAMPLE:
a([1 => [1 => 1], 2 => [2 => 2]])->diffRecursive([1 => [1 => 1]]); // Arrayy[2 => [2 => 2]]
, (*200)
Parameters:
- array $array
- null|array<TKey, T>|\Generator<TKey, T> $helperVariableForRecursion <p>(only for internal usage)</p>
, (*201)
Return:
- static <p>(Immutable)</p>
, (*202)
diffReverse(array $array): static
â
Return elements where the values that are only in the new $array., (*203)
EXAMPLE:
a([1 => 1])->diffReverse([1 => 1, 2 => 2]); // Arrayy[2 => 2]
, (*204)
Parameters:
- array $array
, (*205)
Return:
- static <p>(Immutable)</p>
, (*206)
divide(): static
â
Divide an array into two arrays. One with keys and the other with values., (*207)
EXAMPLE:
a(['a' => 1, 'b' => ''])->divide(); // Arrayy[Arrayy['a', 'b'], Arrayy[1, '']]
, (*208)
Parameters:
nothing, (*209)
Return:
- static <p>(Immutable)</p>
, (*210)
each(\Closure $closure): static
â
Iterate over the current array and modify the array's value., (*211)
EXAMPLE:
$result = A::create();
$closure = function ($value) {
return ':' . $value . ':';
};
a(['foo', 'bar' => 'bis'])->each($closure); // Arrayy[':foo:', 'bar' => ':bis:']
, (*212)
Parameters:
- \Closure(T , ?TKey ): T $closure
, (*213)
Return:
- static <p>(Immutable)</p>
, (*214)
end(): false|mixed
â
Sets the internal iterator to the last element in the array and returns this element., (*215)
Parameters:
nothing, (*216)
Return:
- false|mixed
, (*217)
exchangeArray(array|mixed|static $data): array
â
Exchange the array for another one., (*218)
Parameters:
- T|array<TKey, T>|self<TKey, T> $data 1. use the current array, if it's a array
2. fallback to empty array, if there is nothing
3. call "getArray()" on object, if there is a "Arrayy"-object
4. call "createFromObject()" on object, if there is a "\Traversable"-object
5. call "__toArray()" on object, if the method exists
6. cast a string or object with "__toString()" into an array
7. throw a "InvalidArgumentException"-Exception
, (*219)
Return:
- array
, (*220)
exists(\Closure $closure): bool
â
Check if a value is in the current array using a closure., (*221)
EXAMPLE:
$callable = function ($value, $key) {
return 2 === $key and 'two' === $value;
};
a(['foo', 2 => 'two'])->exists($callable); // true
, (*222)
Parameters:
- \Closure(T , TKey ): bool $closure
, (*223)
Return:
- bool <p>Returns true if the given value is found, false otherwise.</p>
, (*224)
fillWithDefaults(int $num, mixed $default): static
â
Fill the array until "$num" with "$default" values., (*225)
EXAMPLE:
a(['bar'])->fillWithDefaults(3, 'foo'); // Arrayy['bar', 'foo', 'foo']
, (*226)
Parameters:
- int $num
- T $default
, (*227)
Return:
- static <p>(Immutable)</p>
, (*228)
filter(\Closure|null $closure, int $flag): static
â
Find all items in an array that pass the truth test., (*229)
EXAMPLE:
$closure = function ($value) {
return $value % 2 !== 0;
}
a([1, 2, 3, 4])->filter($closure); // Arrayy[0 => 1, 2 => 3]
, (*230)
Parameters:
- null|\Closure(T , TKey = default): bool|\Closure(T ): bool|\Closure(TKey ): bool $closure [optional] <p>
The callback function to use
</p>
<p>
If no callback is supplied, all entries of
input equal to false (see
converting to
boolean) will be removed.
</p>
- int $flag [optional] <p>
Flag determining what arguments are sent to <i>callback</i>:
</p>
<ul>
<li>
<b>ARRAY_FILTER_USE_KEY</b> (1) - pass key as the only argument
to <i>callback</i> instead of the value
</li>
<li>
<b>ARRAY_FILTER_USE_BOTH</b> (2) - pass both value and key as
arguments to <i>callback</i> instead of the value
</li>
</ul>
, (*231)
Return:
- static <p>(Immutable)</p>
, (*232)
filterBy(string $property, mixed $value, string|null $comparisonOp): static
â
Filters an array of objects (or a numeric array of associative arrays) based on the value of a particular
property within that., (*233)
Parameters:
- string $property
- array|T $value
- string|null $comparisonOp <p>
'eq' (equals),<br />
'gt' (greater),<br />
'gte' || 'ge' (greater or equals),<br />
'lt' (less),<br />
'lte' || 'le' (less or equals),<br />
'ne' (not equals),<br />
'contains',<br />
'notContains',<br />
'newer' (via strtotime),<br />
'older' (via strtotime),<br />
</p>
, (*234)
Return:
- static <p>(Immutable)</p>
, (*235)
find(\Closure $closure): false|mixed
â
Find the first item in an array that passes the truth test, otherwise return false., (*236)
EXAMPLE:
$search = 'foo';
$closure = function ($value, $key) use ($search) {
return $value === $search;
};
a(['foo', 'bar', 'lall'])->find($closure); // 'foo'
, (*237)
Parameters:
- \Closure(T , TKey ): bool $closure
, (*238)
Return:
- false|mixed <p>Return false if we did not find the value.</p>
, (*239)
findBy(string $property, mixed $value, string $comparisonOp): static
â
find by ..., (*240)
EXAMPLE:
$array = [
0 => ['id' => 123, 'name' => 'foo', 'group' => 'primary', 'value' => 123456, 'when' => '2014-01-01'],
1 => ['id' => 456, 'name' => 'bar', 'group' => 'primary', 'value' => 1468, 'when' => '2014-07-15'],
];
a($array)->filterBy('name', 'foo'); // Arrayy[0 => ['id' => 123, 'name' => 'foo', 'group' => 'primary', 'value' => 123456, 'when' => '2014-01-01']]
, (*241)
Parameters:
- string $property
- array|T $value
- string $comparisonOp
, (*242)
Return:
- static <p>(Immutable)</p>
, (*243)
first(): mixed|null
â
Get the first value from the current array., (*244)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->first(); // 'foo'
, (*245)
Parameters:
nothing, (*246)
Return:
- mixed|null <p>Return null if there wasn't a element.</p>
, (*247)
firstKey(): mixed|null
â
Get the first key from the current array., (*248)
Parameters:
nothing, (*249)
Return:
- mixed|null <p>Return null if there wasn't a element.</p>
, (*250)
firstsImmutable(int|null $number): static
â
Get the first value(s) from the current array., (*251)
And will return an empty array if there was no first entry., (*252)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->firstsImmutable(2); // Arrayy[0 => 'foo', 1 => 'bar']
, (*253)
Parameters:
- int|null $number <p>How many values you will take?</p>
, (*254)
Return:
- static <p>(Immutable)</p>
, (*255)
firstsKeys(int|null $number): static
â
Get the first value(s) from the current array., (*256)
And will return an empty array if there was no first entry., (*257)
Parameters:
- int|null $number <p>How many values you will take?</p>
, (*258)
Return:
- static <p>(Immutable)</p>
, (*259)
firstsMutable(int|null $number): $this
â
Get and remove the first value(s) from the current array., (*260)
And will return an empty array if there was no first entry., (*261)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->firstsMutable(); // 'foo'
, (*262)
Parameters:
- int|null $number <p>How many values you will take?</p>
, (*263)
Return:
- $this <p>(Mutable)</p>
, (*264)
flatten(string $delimiter, string $prepend, array|null $items): array
â
Flatten an array with the given character as a key delimiter., (*265)
EXAMPLE:
$dot = a(['foo' => ['abc' => 'xyz', 'bar' => ['baz']]]);
$flatten = $dot->flatten();
$flatten['foo.abc']; // 'xyz'
$flatten['foo.bar.0']; // 'baz'
, (*266)
Parameters:
- string $delimiter
- string $prepend
- array|null $items
, (*267)
Return:
- array
, (*268)
flip(): static
â
Exchanges all keys with their associated values in an array., (*269)
EXAMPLE:
a([0 => 'foo', 1 => 'bar'])->flip(); // Arrayy['foo' => 0, 'bar' => 1]
, (*270)
Parameters:
nothing, (*271)
Return:
- static <p>(Immutable)</p>
, (*272)
get(int|string $key, mixed $fallback, array|null $array, bool $useByReference): mixed|static
â
Get a value from an array (optional using dot-notation)., (*273)
EXAMPLE:
$arrayy = a(['user' => ['lastname' => 'Moelleken']]);
$arrayy->get('user.lastname'); // 'Moelleken'
// ---
$arrayy = new A();
$arrayy['user'] = ['lastname' => 'Moelleken'];
$arrayy['user.firstname'] = 'Lars';
$arrayy['user']['lastname']; // Moelleken
$arrayy['user.lastname']; // Moelleken
$arrayy['user.firstname']; // Lars
, (*274)
Parameters:
- TKey $key <p>The key to look for.</p>
- mixed $fallback <p>Value to fallback to.</p>
- array|null $array <p>The array to get from, if it's set to "null" we use the current array from the
class.</p>
- bool $useByReference
, (*275)
Return:
- mixed|static
, (*276)
getAll(): array
â
alias: for "Arrayy->toArray()", (*277)
Parameters:
nothing, (*278)
Return:
- array
, (*279)
getArray(bool $convertAllArrayyElements, bool $preserveKeys): array
â
Get the current array from the "Arrayy"-object., (*280)
alias for "toArray()", (*281)
Parameters:
- bool $convertAllArrayyElements <p>
Convert all Child-"Arrayy" objects also to arrays.
</p>
- bool $preserveKeys <p>
e.g.: A generator maybe return the same key more than once,
so maybe you will ignore the keys.
</p>
, (*282)
Return:
- array
, (*283)
getArrayCopy(): array
â
Creates a copy of the ArrayyObject., (*284)
Parameters:
nothing, (*285)
Return:
- array
, (*286)
getBackwardsGenerator(): Generator
â
Get the current array from the "Arrayy"-object as generator., (*287)
Parameters:
nothing, (*288)
Return:
- \Generator
, (*289)
getColumn(int|string|null $columnKey, int|string|null $indexKey): static
â
Returns the values from a single column of the input array, identified by
the $columnKey, can be used to extract data-columns from multi-arrays., (*290)
EXAMPLE:
a([['foo' => 'bar', 'id' => 1], ['foo => 'lall', 'id' => 2]])->getColumn('foo', 'id'); // Arrayy[1 => 'bar', 2 => 'lall']
, (*291)
INFO: Optionally, you may provide an $indexKey to index the values in the returned
array by the values from the $indexKey column in the input array., (*292)
Parameters:
- int|string|null $columnKey
- int|string|null $indexKey
, (*293)
Return:
- static <p>(Immutable)</p>
, (*294)
getFlags():
â, (*295)
Parameters:
nothing, (*296)
Return:
- TODO: __not_detected__
, (*297)
getGenerator(): Generator
â
Get the current array from the "Arrayy"-object as generator., (*298)
Parameters:
nothing, (*299)
Return:
- \Generator
, (*300)
getGeneratorByReference(): Generator
â
Get the current array from the "Arrayy"-object as generator by reference., (*301)
Parameters:
nothing, (*302)
Return:
- \Generator
, (*303)
getIterator(): Iteratormixed,mixed
â
Returns a new iterator, thus implementing the \Iterator interface., (*304)
EXAMPLE:
a(['foo', 'bar'])->getIterator(); // ArrayyIterator['foo', 'bar']
, (*305)
Parameters:
nothing, (*306)
Return:
- \Iterator<mixed,mixed> <p>An iterator for the values in the array.</p>
, (*307)
getIteratorClass(): string
â
Gets the iterator classname for the ArrayObject., (*308)
Parameters:
nothing, (*309)
Return:
- string
, (*310)
getKeys(): static
â
alias: for "Arrayy->keys()", (*311)
Parameters:
nothing, (*312)
Return:
- static <p>(Immutable)</p>
, (*313)
getList(bool $convertAllArrayyElements): array
â
Get the current array from the "Arrayy"-object as list., (*314)
alias for "toList()", (*315)
Parameters:
- bool $convertAllArrayyElements <p>
Convert all Child-"Arrayy" objects also to arrays.
</p>
, (*316)
Return:
- array
, (*317)
getObject(): stdClass
â
Get the current array from the "Arrayy"-object as object., (*318)
Parameters:
nothing, (*319)
Return:
- \stdClass
, (*320)
â, (*321)
Parameters:
nothing, (*322)
Return:
- array<array-key,\TypeCheckInterface>|\TypeCheckArray<array-key,\TypeCheckInterface>
, (*323)
getRandom(): static
â
alias: for "Arrayy->randomImmutable()", (*324)
Parameters:
nothing, (*325)
Return:
- static <p>(Immutable)</p>
, (*326)
getRandomKey(): mixed|null
â
alias: for "Arrayy->randomKey()", (*327)
Parameters:
nothing, (*328)
Return:
- mixed|null <p>Get a key/index or null if there wasn't a key/index.</p>
, (*329)
getRandomKeys(int $number): static
â
alias: for "Arrayy->randomKeys()", (*330)
Parameters:
- int $number
, (*331)
Return:
- static <p>(Immutable)</p>
, (*332)
getRandomValue(): mixed|null
â
alias: for "Arrayy->randomValue()", (*333)
Parameters:
nothing, (*334)
Return:
- mixed|null <p>Get a random value or null if there wasn't a value.</p>
, (*335)
getRandomValues(int $number): static
â
alias: for "Arrayy->randomValues()", (*336)
Parameters:
- int $number
, (*337)
Return:
- static <p>(Immutable)</p>
, (*338)
getValues(): static
â
Gets all values., (*339)
Parameters:
nothing, (*340)
Return:
- static <p>The values of all elements in this array, in the order they
appear in the array.</p>
, (*341)
getValuesYield(): Generator
â
Gets all values via Generator., (*342)
Parameters:
nothing, (*343)
Return:
- \Generator <p>The values of all elements in this array, in the order they
appear in the array as Generator.</p>
, (*344)
group(callable|int|string $grouper, bool $saveKeys): static
â
Group values from a array according to the results of a closure., (*345)
Parameters:
- \Closure(T , TKey ): TKey|TKey $grouper <p>A callable function name.</p>
- bool $saveKeys
, (*346)
Return:
- static <p>(Immutable)</p>
, (*347)
has(mixed $key): bool
â
Check if an array has a given key., (*348)
Parameters:
- null|TKey|TKey[] $key
, (*349)
Return:
- bool
, (*350)
hasValue(mixed $value): bool
â
Check if an array has a given value., (*351)
INFO: If you need to search recursive please use contains($value, true)
., (*352)
Parameters:
- T $value
, (*353)
Return:
- bool
, (*354)
implode(string $glue, string $prefix): string
â
Implodes the values of this array., (*355)
EXAMPLE:
a([0 => -9, 1, 2])->implode('|'); // '-9|1|2'
, (*356)
Parameters:
- string $glue
- string $prefix
, (*357)
Return:
- string
, (*358)
implodeKeys(string $glue): string
â
Implodes the keys of this array., (*359)
Parameters:
- string $glue
, (*360)
Return:
- string
, (*361)
indexBy(int|string $key): static
â
Given a list and an iterate-function that returns
a key for each element in the list (or a property name),
returns an object with an index of each item., (*362)
Parameters:
- array- $key
, (*363)
Return:
- static <p>(Immutable)</p>
, (*364)
indexOf(mixed $value): false|int|string
â
alias: for "Arrayy->searchIndex()", (*365)
Parameters:
- T $value <p>The value to search for.</p>
, (*366)
Return:
- false|int|string
, (*367)
initial(int $to): static
â
Get everything but the last..$to items., (*368)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->initial(2); // Arrayy[0 => 'foo']
, (*369)
Parameters:
- int $to
, (*370)
Return:
- static <p>(Immutable)</p>
, (*371)
intersection(array $search, bool $keepKeys): static
â
Return an array with all elements found in input array., (*372)
EXAMPLE:
a(['foo', 'bar'])->intersection(['bar', 'baz']); // Arrayy['bar']
, (*373)
Parameters:
- array<TKey, T> $search
- bool $keepKeys
, (*374)
Return:
- static <p>(Immutable)</p>
, (*375)
intersectionMulti(array $array): static
â
Return an array with all elements found in input array., (*376)
Parameters:
- array ...$array
, (*377)
Return:
- static <p>(Immutable)</p>
, (*378)
intersects(array $search): bool
â
Return a boolean flag which indicates whether the two input arrays have any common elements., (*379)
EXAMPLE:
a(['foo', 'bar'])->intersects(['fÜÜ', 'bär']); // false
, (*380)
Parameters:
- array<TKey, T> $search
, (*381)
Return:
- bool
, (*382)
invoke(callable $callable, mixed $arguments): static
â
Invoke a function on all of an array's values., (*383)
Parameters:
- callable $callable
- mixed $arguments
, (*384)
Return:
- static <p>(Immutable)</p>
, (*385)
isAssoc(bool $recursive): bool
â
Check whether array is associative or not., (*386)
EXAMPLE:
a(['foo' => 'bar', 2, 3])->isAssoc(); // true
, (*387)
Parameters:
- bool $recursive
, (*388)
Return:
- bool <p>Returns true if associative, false otherwise.</p>
, (*389)
isEmpty(int|int[]|string|string[]|null $keys): bool
â
Check if a given key or keys are empty., (*390)
Parameters:
- int|int[]|string|string[]|null $keys
, (*391)
Return:
- bool <p>Returns true if empty, false otherwise.</p>
, (*392)
isEqual(array $array): bool
â
Check if the current array is equal to the given "$array" or not., (*393)
EXAMPLE:
a(['đŠ'])->isEqual(['đŠ']); // true
, (*394)
Parameters:
- array $array
, (*395)
Return:
- bool
, (*396)
isMultiArray(): bool
â
Check if the current array is a multi-array., (*397)
EXAMPLE:
a(['foo' => [1, 2 , 3]])->isMultiArray(); // true
, (*398)
Parameters:
nothing, (*399)
Return:
- bool
, (*400)
isNumeric(): bool
â
Check whether array is numeric or not., (*401)
Parameters:
nothing, (*402)
Return:
- bool <p>Returns true if numeric, false otherwise.</p>
, (*403)
isSequential(bool $recursive): bool
â
Check if the current array is sequential [0, 1, 2, 3, 4, 5 ...] or not., (*404)
EXAMPLE:
a([0 => 'foo', 1 => 'lall', 2 => 'foobar'])->isSequential(); // true
, (*405)
INFO: If the array is empty we count it as non-sequential., (*406)
Parameters:
- bool $recursive
, (*407)
Return:
- bool
, (*408)
jsonSerialize(): array
â, (*409)
Parameters:
nothing, (*410)
Return:
- array
, (*411)
key(): int|string|null
â
Gets the key/index of the element at the current internal iterator position., (*412)
Parameters:
nothing, (*413)
Return:
- int|string|null
, (*414)
keyExists(int|string $key): bool
â
Checks if the given key exists in the provided array., (*415)
INFO: This method only use "array_key_exists()" if you want to use "dot"-notation,
then you need to use "Arrayy->offsetExists()"., (*416)
Parameters:
- int|string $key the key to look for
, (*417)
Return:
- bool
, (*418)
keys(bool $recursive, mixed|null $search_values, bool $strict): static
â
Get all keys from the current array., (*419)
EXAMPLE:
a([1 => 'foo', 2 => 'foo2', 3 => 'bar'])->keys(); // Arrayy[1, 2, 3]
, (*420)
Parameters:
- bool $recursive [optional] <p>
Get all keys, also from all sub-arrays from an multi-dimensional array.
</p>
- null|T|T[] $search_values [optional] <p>
If specified, then only keys containing these values are returned.
</p>
- bool $strict [optional] <p>
Determines if strict comparison (===) should be used during the search.
</p>
, (*421)
Return:
- static <p>(Immutable) An array of all the keys in input.</p>
, (*422)
krsort(int $sort_flags): $this
â
Sort an array by key in reverse order., (*423)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*424)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*425)
krsortImmutable(int $sort_flags): $this
â
Sort an array by key in reverse order., (*426)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*427)
Return:
- $this <p>(Immutable)</p>
, (*428)
ksort(int $sort_flags): $this
â
Sort the entries by key., (*429)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*430)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*431)
ksortImmutable(int $sort_flags): $this
â
Sort the entries by key., (*432)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*433)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*434)
last(): mixed|null
â
Get the last value from the current array., (*435)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->last(); // 'lall'
, (*436)
Parameters:
nothing, (*437)
Return:
- mixed|null <p>Return null if there wasn't a element.</p>
, (*438)
lastKey(): mixed|null
â
Get the last key from the current array., (*439)
Parameters:
nothing, (*440)
Return:
- mixed|null <p>Return null if there wasn't a element.</p>
, (*441)
lastsImmutable(int|null $number): static
â
Get the last value(s) from the current array., (*442)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->lasts(2); // Arrayy[0 => 'bar', 1 => 'lall']
, (*443)
Parameters:
- int|null $number
, (*444)
Return:
- static <p>(Immutable)</p>
, (*445)
lastsMutable(int|null $number): $this
â
Get the last value(s) from the current array., (*446)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->lasts(2); // Arrayy[0 => 'bar', 1 => 'lall']
, (*447)
Parameters:
- int|null $number
, (*448)
Return:
- $this <p>(Mutable)</p>
, (*449)
length(int $mode): int
â
Count the values from the current array., (*450)
alias: for "Arrayy->count()", (*451)
Parameters:
- int $mode
, (*452)
Return:
- int
, (*453)
map(callable $callable, bool $useKeyAsSecondParameter, mixed $arguments): static
â
Apply the given function to the every element of the array,
collecting the results., (*454)
EXAMPLE:
a(['foo', 'Foo'])->map('mb_strtoupper'); // Arrayy['FOO', 'FOO']
, (*455)
Parameters:
- callable $callable
- bool $useKeyAsSecondParameter
- mixed ...$arguments
, (*456)
Return:
- static <p>(Immutable) Arrayy object with modified elements.</p>
, (*457)
matches(\Closure $closure): bool
â
Check if all items in current array match a truth test., (*458)
EXAMPLE:
$closure = function ($value, $key) {
return ($value % 2 === 0);
};
a([2, 4, 8])->matches($closure); // true
, (*459)
Parameters:
- \Closure(T , TKey ): bool $closure
, (*460)
Return:
- bool
, (*461)
matchesAny(\Closure $closure): bool
â
Check if any item in the current array matches a truth test., (*462)
EXAMPLE:
$closure = function ($value, $key) {
return ($value % 2 === 0);
};
a([1, 4, 7])->matches($closure); // true
, (*463)
Parameters:
- \Closure(T , TKey ): bool $closure
, (*464)
Return:
- bool
, (*465)
max(): false|float|int|string
â
Get the max value from an array., (*466)
EXAMPLE:
a([-9, -8, -7, 1.32])->max(); // 1.32
, (*467)
Parameters:
nothing, (*468)
Return:
- false|float|int|string <p>Will return false if there are no values.</p>
, (*469)
mergeAppendKeepIndex(array $array, bool $recursive): static
â
Merge the new $array into the current array., (*470)
- keep key,value from the current array, also if the index is in the new $array
EXAMPLE:
$array1 = [1 => 'one', 'foo' => 'bar1'];
$array2 = ['foo' => 'bar2', 3 => 'three'];
a($array1)->mergeAppendKeepIndex($array2); // Arrayy[1 => 'one', 'foo' => 'bar2', 3 => 'three']
// ---
$array1 = [0 => 'one', 1 => 'foo'];
$array2 = [0 => 'foo', 1 => 'bar2'];
a($array1)->mergeAppendKeepIndex($array2); // Arrayy[0 => 'foo', 1 => 'bar2']
, (*471)
Parameters:
- array $array
- bool $recursive
, (*472)
Return:
- static <p>(Immutable)</p>
, (*473)
mergeAppendNewIndex(array $array, bool $recursive): static
â
Merge the new $array into the current array., (*474)
- replace duplicate assoc-keys from the current array with the key,values from the new $array
- create new indexes
EXAMPLE:
$array1 = [1 => 'one', 'foo' => 'bar1'];
$array2 = ['foo' => 'bar2', 3 => 'three'];
a($array1)->mergeAppendNewIndex($array2); // Arrayy[0 => 'one', 'foo' => 'bar2', 1 => 'three']
// ---
$array1 = [0 => 'one', 1 => 'foo'];
$array2 = [0 => 'foo', 1 => 'bar2'];
a($array1)->mergeAppendNewIndex($array2); // Arrayy[0 => 'one', 1 => 'foo', 2 => 'foo', 3 => 'bar2']
, (*475)
Parameters:
- array $array
- bool $recursive
, (*476)
Return:
- static <p>(Immutable)</p>
, (*477)
mergePrependKeepIndex(array $array, bool $recursive): static
â
Merge the the current array into the $array., (*478)
- use key,value from the new $array, also if the index is in the current array
EXAMPLE:
$array1 = [1 => 'one', 'foo' => 'bar1'];
$array2 = ['foo' => 'bar2', 3 => 'three'];
a($array1)->mergePrependKeepIndex($array2); // Arrayy['foo' => 'bar1', 3 => 'three', 1 => 'one']
// ---
$array1 = [0 => 'one', 1 => 'foo'];
$array2 = [0 => 'foo', 1 => 'bar2'];
a($array1)->mergePrependKeepIndex($array2); // Arrayy[0 => 'one', 1 => 'foo']
, (*479)
Parameters:
- array $array
- bool $recursive
, (*480)
Return:
- static <p>(Immutable)</p>
, (*481)
mergePrependNewIndex(array $array, bool $recursive): static
â
Merge the current array into the new $array., (*482)
- replace duplicate assoc-keys from new $array with the key,values from the current array
- create new indexes
EXAMPLE:
$array1 = [1 => 'one', 'foo' => 'bar1'];
$array2 = ['foo' => 'bar2', 3 => 'three'];
a($array1)->mergePrependNewIndex($array2); // Arrayy['foo' => 'bar1', 0 => 'three', 1 => 'one']
// ---
$array1 = [0 => 'one', 1 => 'foo'];
$array2 = [0 => 'foo', 1 => 'bar2'];
a($array1)->mergePrependNewIndex($array2); // Arrayy[0 => 'foo', 1 => 'bar2', 2 => 'one', 3 => 'foo']
, (*483)
Parameters:
- array $array
- bool $recursive
, (*484)
Return:
- static <p>(Immutable)</p>
, (*485)
â, (*486)
Parameters:
nothing, (*487)
Return:
- \ArrayyMeta|mixed|static
, (*488)
min(): false|mixed
â
Get the min value from an array., (*489)
EXAMPLE:
a([-9, -8, -7, 1.32])->min(); // -9
, (*490)
Parameters:
nothing, (*491)
Return:
- false|mixed <p>Will return false if there are no values.</p>
, (*492)
mostUsedValue(): mixed|null
â
Get the most used value from the array., (*493)
Parameters:
nothing, (*494)
Return:
- mixed|null <p>(Immutable) Return null if there wasn't an element.</p>
, (*495)
mostUsedValues(int|null $number): static
â
Get the most used value from the array., (*496)
Parameters:
- int|null $number <p>How many values you will take?</p>
, (*497)
Return:
- static <p>(Immutable)</p>
, (*498)
moveElement(int|string $from, int $to): static
â
Move an array element to a new index., (*499)
EXAMPLE:
$arr2 = new A(['A' => 'a', 'B' => 'b', 'C' => 'c', 'D' => 'd', 'E' => 'e']);
$newArr2 = $arr2->moveElement('D', 1); // Arrayy['A' => 'a', 'D' => 'd', 'B' => 'b', 'C' => 'c', 'E' => 'e']
, (*500)
Parameters:
- int|string $from
- int $to
, (*501)
Return:
- static <p>(Immutable)</p>
, (*502)
moveElementToFirstPlace(int|string $key): static
â
Move an array element to the first place., (*503)
INFO: Instead of "Arrayy->moveElement()" this method will NOT
loss the keys of an indexed array., (*504)
Parameters:
- int|string $key
, (*505)
Return:
- static <p>(Immutable)</p>
, (*506)
moveElementToLastPlace(int|string $key): static
â
Move an array element to the last place., (*507)
INFO: Instead of "Arrayy->moveElement()" this method will NOT
loss the keys of an indexed array., (*508)
Parameters:
- int|string $key
, (*509)
Return:
- static <p>(Immutable)</p>
, (*510)
natcasesort(): $this
â
Sort an array using a case insensitive "natural order" algorithm., (*511)
Parameters:
nothing, (*512)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*513)
natcasesortImmutable(): $this
â
Sort an array using a case insensitive "natural order" algorithm., (*514)
Parameters:
nothing, (*515)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*516)
natsort(): $this
â
Sort entries using a "natural order" algorithm., (*517)
Parameters:
nothing, (*518)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*519)
natsortImmutable(): $this
â
Sort entries using a "natural order" algorithm., (*520)
Parameters:
nothing, (*521)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*522)
next(): false|mixed
â
Moves the internal iterator position to the next element and returns this element., (*523)
Parameters:
nothing, (*524)
Return:
- false|mixed <p>(Mutable) Will return false if there are no values.</p>
, (*525)
nth(int $step, int $offset): static
â
Get the next nth keys and values from the array., (*526)
Parameters:
- int $step
- int $offset
, (*527)
Return:
- static <p>(Immutable)</p>
, (*528)
offsetExists(bool|int|string $offset): bool
â
Whether or not an offset exists., (*529)
Parameters:
- bool|int|string $offset
, (*530)
Return:
- bool
, (*531)
offsetGet(int|string $offset): mixed
â
Returns the value at specified offset., (*532)
Parameters:
- TKey $offset
, (*533)
Return:
- mixed <p>Will return null if the offset did not exists.</p>
, (*534)
offsetSet(int|string|null $offset, mixed $value): void
â
Assigns a value to the specified offset + check the type., (*535)
Parameters:
- int|string|null $offset
- mixed $value
, (*536)
Return:
- void
, (*537)
offsetUnset(int|string $offset): void
â
Unset an offset., (*538)
Parameters:
- int|string $offset
, (*539)
Return:
- void <p>(Mutable) Return nothing.</p>
, (*540)
only(int[]|string[] $keys): static
â
Get a subset of the items from the given array., (*541)
Parameters:
- array-key[] $keys
, (*542)
Return:
- static <p>(Immutable)</p>
, (*543)
pad(int $size, mixed $value): static
â
Pad array to the specified size with a given value., (*544)
Parameters:
- int $size <p>Size of the result array.</p>
- mixed $value <p>Empty value by default.</p>
, (*545)
Return:
- static <p>(Immutable) Arrayy object padded to $size with $value.</p>
, (*546)
partition(\Closure $closure): arrayint,static
â
Partitions this array in two array according to a predicate., (*547)
Keys are preserved in the resulting array., (*548)
Parameters:
- \Closure(T , TKey ): bool $closure <p>The predicate on which to partition.</p>
, (*549)
Return:
- array<int,static> <p>An array with two elements. The first element contains the array
of elements where the predicate returned TRUE, the second element
contains the array of elements where the predicate returned FALSE.</p>
, (*550)
pop(): mixed|null
â
Pop a specified value off the end of the current array., (*551)
Parameters:
nothing, (*552)
Return:
- mixed|null <p>(Mutable) The popped element from the current array or null if the array is e.g. empty.</p>
, (*553)
prepend(mixed $value, mixed $key): $this
â
Prepend a (key) + value to the current array., (*554)
EXAMPLE:
a(['fòô' => 'bĂ Ĺ'])->prepend('foo'); // Arrayy[0 => 'foo', 'fòô' => 'bĂ Ĺ']
, (*555)
Parameters:
- T $value
- TKey|null $key
, (*556)
Return:
- $this <p>(Mutable) Return this Arrayy object, with the prepended value.</p>
, (*557)
prependImmutable(mixed $value, mixed $key): $this
â
Prepend a (key) + value to the current array., (*558)
EXAMPLE:
a(['fòô' => 'bĂ Ĺ'])->prependImmutable('foo')->getArray(); // [0 => 'foo', 'fòô' => 'bĂ Ĺ']
, (*559)
Parameters:
- T $value
- TKey $key
, (*560)
Return:
- $this <p>(Immutable) Return this Arrayy object, with the prepended value.</p>
, (*561)
prependToEachKey(float|int|string $suffix): static
â
Add a suffix to each key., (*562)
Parameters:
- float|int|string $suffix
, (*563)
Return:
- static <p>(Immutable) Return an Arrayy object, with the prepended keys.</p>
, (*564)
prependToEachValue(float|int|string $suffix): static
â
Add a suffix to each value., (*565)
Parameters:
- float|int|string $suffix
, (*566)
Return:
- static <p>(Immutable) Return an Arrayy object, with the prepended values.</p>
, (*567)
pull(int|int[]|string|string[]|null $keyOrKeys, mixed $fallback): mixed
â
Return the value of a given key and
delete the key., (*568)
Parameters:
- int|int[]|string|string[]|null $keyOrKeys
- TFallback $fallback
, (*569)
Return:
- mixed
, (*570)
push(mixed $args): $this
â
Push one or more values onto the end of array at once., (*571)
Parameters:
- array<TKey, T> ...$args
, (*572)
Return:
- $this <p>(Mutable) Return this Arrayy object, with pushed elements to the end of array.</p>
, (*573)
randomImmutable(int|null $number): static
â
Get a random value from the current array., (*574)
EXAMPLE:
a([1, 2, 3, 4])->randomImmutable(2); // e.g.: Arrayy[1, 4]
, (*575)
Parameters:
- int|null $number <p>How many values you will take?</p>
, (*576)
Return:
- static <p>(Immutable)</p>
, (*577)
randomKey(): mixed|null
â
Pick a random key/index from the keys of this array., (*578)
EXAMPLE:
$arrayy = A::create([1 => 'one', 2 => 'two']);
$arrayy->randomKey(); // e.g. 2
, (*579)
Parameters:
nothing, (*580)
Return:
- mixed|null <p>Get a key/index or null if there wasn't a key/index.</p>
, (*581)
randomKeys(int $number): static
â
Pick a given number of random keys/indexes out of this array., (*582)
EXAMPLE:
a([1 => 'one', 2 => 'two'])->randomKeys(); // e.g. Arrayy[1, 2]
, (*583)
Parameters:
- int $number <p>The number of keys/indexes (should be <= \count($this->array))</p>
, (*584)
Return:
- static <p>(Immutable)</p>
, (*585)
randomMutable(int|null $number): $this
â
Get a random value from the current array., (*586)
EXAMPLE:
a([1, 2, 3, 4])->randomMutable(2); // e.g.: Arrayy[1, 4]
, (*587)
Parameters:
- int|null $number <p>How many values you will take?</p>
, (*588)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*589)
randomValue(): mixed
â
Pick a random value from the values of this array., (*590)
EXAMPLE:
a([1 => 'one', 2 => 'two'])->randomValue(); // e.g. 'one'
, (*591)
Parameters:
nothing, (*592)
Return:
- mixed <p>Get a random value or null if there wasn't a value.</p>
, (*593)
randomValues(int $number): static
â
Pick a given number of random values out of this array., (*594)
EXAMPLE:
a([1 => 'one', 2 => 'two'])->randomValues(); // e.g. Arrayy['one', 'two']
, (*595)
Parameters:
- int $number
, (*596)
Return:
- static <p>(Mutable)</p>
, (*597)
randomWeighted(array $array, int $number):
â, (*598)
Parameters:
- array $array
- int $number
, (*599)
Return:
- self
, (*600)
reduce(callable $callable, mixed $initial): static
â
Reduce the current array via callable e.g. anonymous-function and return the end result., (*601)
EXAMPLE:
a([1, 2, 3, 4])->reduce(
function ($carry, $item) {
return $carry * $item;
},
1
); // Arrayy[24]
, (*602)
Parameters:
- callable $callable
- T2 $initial
, (*603)
Return:
- static <p>(Immutable)</p>
, (*604)
reduce_dimension(bool $unique): static
â, (*605)
Parameters:
- bool $unique
, (*606)
Return:
- static <p>(Immutable)</p>
, (*607)
reindex(): $this
â
Create a numerically re-indexed Arrayy object., (*608)
EXAMPLE:
a([2 => 1, 3 => 2])->reindex(); // Arrayy[0 => 1, 1 => 2]
, (*609)
Parameters:
nothing, (*610)
Return:
- $this <p>(Mutable) Return this Arrayy object, with re-indexed array-elements.</p>
, (*611)
reject(\Closure $closure): static
â
Return all items that fail the truth test., (*612)
EXAMPLE:
$closure = function ($value) {
return $value % 2 !== 0;
}
a([1, 2, 3, 4])->reject($closure); // Arrayy[1 => 2, 3 => 4]
, (*613)
Parameters:
- \Closure(T , TKey ): bool $closure
, (*614)
Return:
- static <p>(Immutable)</p>
, (*615)
remove(mixed $key): static
â
Remove a value from the current array (optional using dot-notation)., (*616)
EXAMPLE:
a([1 => 'bar', 'foo' => 'foo'])->remove(1); // Arrayy['foo' => 'foo']
, (*617)
Parameters:
- TKey|TKey[] $key
, (*618)
Return:
- static <p>(Mutable)</p>
, (*619)
removeElement(mixed $element): static
â
alias: for "Arrayy->removeValue()", (*620)
Parameters:
- T $element
, (*621)
Return:
- static <p>(Immutable)</p>
, (*622)
removeFirst(): static
â
Remove the first value from the current array., (*623)
EXAMPLE:
a([1 => 'bar', 'foo' => 'foo'])->removeFirst(); // Arrayy['foo' => 'foo']
, (*624)
Parameters:
nothing, (*625)
Return:
- static <p>(Immutable)</p>
, (*626)
removeLast(): static
â
Remove the last value from the current array., (*627)
EXAMPLE:
a([1 => 'bar', 'foo' => 'foo'])->removeLast(); // Arrayy[1 => 'bar']
, (*628)
Parameters:
nothing, (*629)
Return:
- static <p>(Immutable)</p>
, (*630)
removeValue(mixed $value): static
â
Removes a particular value from an array (numeric or associative)., (*631)
EXAMPLE:
a([1 => 'bar', 'foo' => 'foo'])->removeValue('foo'); // Arrayy[1 => 'bar']
, (*632)
Parameters:
- T $value
, (*633)
Return:
- static <p>(Immutable)</p>
, (*634)
repeat(int $times): static
â
Generate array of repeated arrays., (*635)
Parameters:
- int $times <p>How many times has to be repeated.</p>
, (*636)
Return:
- static <p>(Immutable)</p>
, (*637)
replace(mixed $oldKey, mixed $newKey, mixed $newValue): static
â
Replace a key with a new key/value pair., (*638)
EXAMPLE:
$arrayy = a([1 => 'foo', 2 => 'foo2', 3 => 'bar']);
$arrayy->replace(2, 'notfoo', 'notbar'); // Arrayy[1 => 'foo', 'notfoo' => 'notbar', 3 => 'bar']
, (*639)
Parameters:
- TKey $oldKey
- TKey $newKey
- T $newValue
, (*640)
Return:
- static <p>(Immutable)</p>
, (*641)
replaceAllKeys(int[]|string[] $keys): static
â
Create an array using the current array as values and the other array as keys., (*642)
EXAMPLE:
$firstArray = [
1 => 'one',
2 => 'two',
3 => 'three',
];
$secondArray = [
'one' => 1,
1 => 'one',
2 => 2,
];
$arrayy = a($firstArray);
$arrayy->replaceAllKeys($secondArray); // Arrayy[1 => "one", 'one' => "two", 2 => "three"]
, (*643)
Parameters:
- array<TKey> $keys <p>An array of keys.</p>
, (*644)
Return:
- static <p>(Immutable) Arrayy object with keys from the other array, empty Arrayy object if the number of elements
for each array isn't equal or if the arrays are empty.
</p>
, (*645)
replaceAllValues(array $array): static
â
Create an array using the current array as keys and the other array as values., (*646)
EXAMPLE:
$firstArray = [
1 => 'one',
2 => 'two',
3 => 'three',
];
$secondArray = [
'one' => 1,
1 => 'one',
2 => 2,
];
$arrayy = a($firstArray);
$arrayy->replaceAllValues($secondArray); // Arrayy['one' => 1, 'two' => 'one', 'three' => 2]
, (*647)
Parameters:
- array $array <p>An array of values.</p>
, (*648)
Return:
- static <p>(Immutable) Arrayy object with values from the other array, empty Arrayy object if the number of elements
for each array isn't equal or if the arrays are empty.
</p>
, (*649)
replaceKeys(array $keys): static
â
Replace the keys in an array with another set., (*650)
EXAMPLE:
a([1 => 'bar', 'foo' => 'foo'])->replaceKeys([1 => 2, 'foo' => 'replaced']); // Arrayy[2 => 'bar', 'replaced' => 'foo']
, (*651)
Parameters:
- array<TKey> $keys <p>An array of keys matching the array's size.</p>
, (*652)
Return:
- static <p>(Immutable)</p>
, (*653)
replaceOneValue(mixed $search, mixed $replacement): static
â
Replace the first matched value in an array., (*654)
EXAMPLE:
$testArray = ['bar', 'foo' => 'foo', 'foobar' => 'foobar'];
a($testArray)->replaceOneValue('foo', 'replaced'); // Arrayy['bar', 'foo' => 'replaced', 'foobar' => 'foobar']
, (*655)
Parameters:
- T $search <p>The value to replace.</p>
- T $replacement <p>The value to replace.</p>
, (*656)
Return:
- static <p>(Immutable)</p>
, (*657)
replaceValues(string $search, string $replacement): static
â
Replace values in the current array., (*658)
EXAMPLE:
$testArray = ['bar', 'foo' => 'foo', 'foobar' => 'foobar'];
a($testArray)->replaceValues('foo', 'replaced'); // Arrayy['bar', 'foo' => 'replaced', 'foobar' => 'replacedbar']
, (*659)
Parameters:
- string $search <p>The value to replace.</p>
- string $replacement <p>What to replace it with.</p>
, (*660)
Return:
- static <p>(Immutable)</p>
, (*661)
rest(int $from): static
â
Get the last elements from index $from until the end of this array., (*662)
EXAMPLE:
a([2 => 'foo', 3 => 'bar', 4 => 'lall'])->rest(2); // Arrayy[0 => 'lall']
, (*663)
Parameters:
- int $from
, (*664)
Return:
- static <p>(Immutable)</p>
, (*665)
reverse(): $this
â
Return the array in the reverse order., (*666)
EXAMPLE:
a([1 => 1, 2 => 2, 3 => 3])->reverse(); // self[3, 2, 1]
, (*667)
Parameters:
nothing, (*668)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*669)
reverseKeepIndex(): $this
â
Return the array with keys in the reverse order., (*670)
EXAMPLE:
a([1 => 1, 2 => 2, 3 => 3])->reverse(); // self[3 => 3, 2 => 2, 1 => 1]
, (*671)
Parameters:
nothing, (*672)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*673)
rsort(int $sort_flags): $this
â
Sort an array in reverse order., (*674)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*675)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*676)
rsortImmutable(int $sort_flags): $this
â
Sort an array in reverse order., (*677)
Parameters:
- int $sort_flags [optional] <p>
You may modify the behavior of the sort using the optional
parameter sort_flags, for details
see sort.
</p>
, (*678)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*679)
searchIndex(mixed $value): false|int|string
â
Search for the first index of the current array via $value., (*680)
EXAMPLE:
a(['fòô' => 'bĂ Ĺ', 'lall' => 'bĂ Ĺ'])->searchIndex('bĂ Ĺ'); // Arrayy[0 => 'fòô']
, (*681)
Parameters:
- T $value
, (*682)
Return:
- false|int|string <p>Will return <b>FALSE</b> if the value can't be found.</p>
, (*683)
searchValue(mixed $index): static
â
Search for the value of the current array via $index., (*684)
EXAMPLE:
a(['fòô' => 'bĂ Ĺ'])->searchValue('fòô'); // Arrayy[0 => 'bĂ Ĺ']
, (*685)
Parameters:
- TKey $index
, (*686)
Return:
- static <p>(Immutable) Will return a empty Arrayy if the value wasn't found.</p>
, (*687)
serialize(): string
â
Serialize the current "Arrayy"-object., (*688)
EXAMPLE:
a([1, 4, 7])->serialize();
, (*689)
Parameters:
nothing, (*690)
Return:
- string
, (*691)
set(string $key, mixed $value): $this
â
Set a value for the current array (optional using dot-notation)., (*692)
EXAMPLE:
$arrayy = a(['Lars' => ['lastname' => 'Moelleken']]);
$arrayy->set('Lars.lastname', 'MĂźller'); // Arrayy['Lars', ['lastname' => 'MĂźller']]]
, (*693)
Parameters:
- TKey $key <p>The key to set.</p>
- T $value <p>Its value.</p>
, (*694)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*695)
setAndGet(mixed $key, mixed $fallback): mixed
â
Get a value from a array and set it if it was not., (*696)
WARNING: this method only set the value, if the $key is not already set, (*697)
EXAMPLE:
$arrayy = a([1 => 1, 2 => 2, 3 => 3]);
$arrayy->setAndGet(1, 4); // 1
$arrayy->setAndGet(0, 4); // 4
, (*698)
Parameters:
- TKey $key <p>The key</p>
- T $fallback <p>The default value to set if it isn't.</p>
, (*699)
Return:
- mixed <p>(Mutable)</p>
, (*700)
setFlags(int $flags):
â, (*701)
Parameters:
- int $flags
, (*702)
Return:
- TODO: __not_detected__
, (*703)
setIteratorClass(string $iteratorClass): void
â
Sets the iterator classname for the current "Arrayy"-object., (*704)
Parameters:
- class-string<\Arrayy\ArrayyIterator> $iteratorClass
, (*705)
Return:
- void
, (*706)
shift(): mixed|null
â
Shifts a specified value off the beginning of array., (*707)
Parameters:
nothing, (*708)
Return:
- mixed|null <p>(Mutable) A shifted element from the current array.</p>
, (*709)
shuffle(bool $secure, array|null $array): static
â
Shuffle the current array., (*710)
EXAMPLE:
a([1 => 'bar', 'foo' => 'foo'])->shuffle(); // e.g.: Arrayy[['foo' => 'foo', 1 => 'bar']]
, (*711)
Parameters:
- bool $secure <p>using a CSPRNG | @see https://paragonie.com/b/JvICXzh_jhLyt4y3</p>
- array|null $array [optional]
, (*712)
Return:
- static <p>(Immutable)</p>
, (*713)
size(int $mode): int
â
Count the values from the current array., (*714)
alias: for "Arrayy->count()", (*715)
Parameters:
- int $mode
, (*716)
Return:
- int
, (*717)
sizeIs(int $size): bool
â
Checks whether array has exactly $size items., (*718)
Parameters:
- int $size
, (*719)
Return:
- bool
, (*720)
sizeIsBetween(int $fromSize, int $toSize): bool
â
Checks whether array has between $fromSize to $toSize items. $toSize can be
smaller than $fromSize., (*721)
Parameters:
- int $fromSize
- int $toSize
, (*722)
Return:
- bool
, (*723)
sizeIsGreaterThan(int $size): bool
â
Checks whether array has more than $size items., (*724)
Parameters:
- int $size
, (*725)
Return:
- bool
, (*726)
sizeIsLessThan(int $size): bool
â
Checks whether array has less than $size items., (*727)
Parameters:
- int $size
, (*728)
Return:
- bool
, (*729)
sizeRecursive(): int
â
Counts all elements in an array, or something in an object., (*730)
For objects, if you have SPL installed, you can hook into count() by implementing interface {@see \Countable}.
The interface has exactly one method, {@see \Countable::count()}, which returns the return value for the count()
function. Please see the {@see \Array} section of the manual for a detailed explanation of how arrays are
implemented and used in PHP.
, (*731)
Parameters:
nothing, (*732)
Return:
- int <p>
The number of elements in var, which is
typically an array, since anything else will have one
element.
</p>
<p>
If var is not an array or an object with
implemented Countable interface,
1 will be returned.
There is one exception, if var is &null;,
0 will be returned.
</p>
<p>
Caution: count may return 0 for a variable that isn't set,
but it may also return 0 for a variable that has been initialized with an
empty array. Use isset to test if a variable is set.
</p>
, (*733)
slice(int $offset, int|null $length, bool $preserveKeys): static
â
Extract a slice of the array., (*734)
Parameters:
- int $offset <p>Slice begin index.</p>
- int|null $length <p>Length of the slice.</p>
- bool $preserveKeys <p>Whether array keys are preserved or no.</p>
, (*735)
Return:
- static <p>(Immutable) A slice of the original array with length $length.</p>
, (*736)
sort(int|string $direction, int $strategy, bool $keepKeys): static
â
Sort the current array and optional you can keep the keys., (*737)
EXAMPLE:
a(3 => 'd', 2 => 'f', 0 => 'a')->sort(SORT_ASC, SORT_NATURAL, false); // Arrayy[0 => 'a', 1 => 'd', 2 => 'f']
, (*738)
Parameters:
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or <strong>SORT_DESC</strong></p>
- int $strategy <p>sort_flags => use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
- bool $keepKeys
, (*739)
Return:
- static <p>(Mutable) Return this Arrayy object.</p>
, (*740)
sortImmutable(int|string $direction, int $strategy, bool $keepKeys): static
â
Sort the current array and optional you can keep the keys., (*741)
Parameters:
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or <strong>SORT_DESC</strong></p>
- int $strategy <p>sort_flags => use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
- bool $keepKeys
, (*742)
Return:
- static <p>(Immutable) Return this Arrayy object.</p>
, (*743)
sortKeys(int|string $direction, int $strategy): $this
â
Sort the current array by key., (*744)
EXAMPLE:
a([1 => 2, 0 => 1])->sortKeys(\SORT_ASC); // Arrayy[0 => 1, 1 => 2]
, (*745)
Parameters:
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or <strong>SORT_DESC</strong></p>
- int $strategy <p>use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
, (*746)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*747)
sortKeysImmutable(int|string $direction, int $strategy): $this
â
Sort the current array by key., (*748)
Parameters:
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or <strong>SORT_DESC</strong></p>
- int $strategy <p>use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
, (*749)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*750)
sortValueKeepIndex(int|string $direction, int $strategy): static
â
Sort the current array by value., (*751)
EXAMPLE:
a(3 => 'd', 2 => 'f', 0 => 'a')->sortValueKeepIndex(SORT_ASC, SORT_REGULAR); // Arrayy[0 => 'a', 3 => 'd', 2 => 'f']
, (*752)
Parameters:
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or <strong>SORT_DESC</strong></p>
- int $strategy <p>use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
, (*753)
Return:
- static <p>(Mutable)</p>
, (*754)
sortValueNewIndex(int|string $direction, int $strategy): static
â
Sort the current array by value., (*755)
EXAMPLE:
a(3 => 'd', 2 => 'f', 0 => 'a')->sortValueNewIndex(SORT_ASC, SORT_NATURAL); // Arrayy[0 => 'a', 1 => 'd', 2 => 'f']
, (*756)
Parameters:
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or <strong>SORT_DESC</strong></p>
- int $strategy <p>use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
, (*757)
Return:
- static <p>(Mutable)</p>
, (*758)
sorter(callable|mixed|null $sorter, int|string $direction, int $strategy): static
â
Sort a array by value or by a closure., (*759)
- If the sorter is null, the array is sorted naturally.
- Associative (string) keys will be maintained, but numeric keys will be re-indexed.
EXAMPLE:
$testArray = range(1, 5);
$under = a($testArray)->sorter(
function ($value) {
return $value % 2 === 0;
}
);
var_dump($under); // Arrayy[1, 3, 5, 2, 4]
, (*760)
Parameters:
- callable|mixed|null $sorter
- int|string $direction <p>use <strong>SORT_ASC</strong> (default) or
<strong>SORT_DESC</strong></p>
- int $strategy <p>use e.g.: <strong>SORT_REGULAR</strong> (default) or
<strong>SORT_NATURAL</strong></p>
, (*761)
Return:
- static <p>(Immutable)</p>
, (*762)
splice(int $offset, int|null $length, array $replacement): static
â, (*763)
Parameters:
- int $offset
- int|null $length
- array<T> $replacement
, (*764)
Return:
- static <p>(Immutable)</p>
, (*765)
split(int $numberOfPieces, bool $keepKeys): static
â
Split an array in the given amount of pieces., (*766)
EXAMPLE:
a(['a' => 1, 'b' => 2])->split(2, true); // Arrayy[['a' => 1], ['b' => 2]]
, (*767)
Parameters:
- int $numberOfPieces
- bool $keepKeys
, (*768)
Return:
- static <p>(Immutable)</p>
, (*769)
stripEmpty(): static
â
Strip all empty items from the current array., (*770)
EXAMPLE:
a(['a' => 1, 'b' => ''])->stripEmpty(); // Arrayy[['a' => 1]]
, (*771)
Parameters:
nothing, (*772)
Return:
- static <p>(Immutable)</p>
, (*773)
swap(int|string $swapA, int|string $swapB): static
â
Swap two values between positions by key., (*774)
EXAMPLE:
a(['a' => 1, 'b' => ''])->swap('a', 'b'); // Arrayy[['a' => '', 'b' => 1]]
, (*775)
Parameters:
- int|string $swapA <p>a key in the array</p>
- int|string $swapB <p>a key in the array</p>
, (*776)
Return:
- static <p>(Immutable)</p>
, (*777)
toArray(bool $convertAllArrayyElements, bool $preserveKeys): array
â
Get the current array from the "Arrayy"-object., (*778)
alias for "getArray()", (*779)
Parameters:
- bool $convertAllArrayyElements <p>
Convert all Child-"Arrayy" objects also to arrays.
</p>
- bool $preserveKeys <p>
e.g.: A generator maybe return the same key more than once,
so maybe you will ignore the keys.
</p>
, (*780)
Return:
- array
, (*781)
toJson(int $options, int $depth): string
â
Convert the current array to JSON., (*782)
EXAMPLE:
a(['bar', ['foo']])->toJson(); // '["bar",{"1":"foo"}]'
, (*783)
Parameters:
- int $options [optional] <p>e.g. JSON_PRETTY_PRINT</p>
- int $depth [optional] <p>Set the maximum depth. Must be greater than zero.</p>
, (*784)
Return:
- string
, (*785)
toList(bool $convertAllArrayyElements): array
â
Get the current array from the "Arrayy"-object as list., (*786)
Parameters:
- bool $convertAllArrayyElements <p>
Convert all Child-"Arrayy" objects also to arrays.
</p>
, (*787)
Return:
- array
, (*788)
toPermutation(string[]|null $items, string[] $helper): static|static[]
â, (*789)
Parameters:
- string[]|null $items [optional]
- string[] $helper [optional]
, (*790)
Return:
- static|static[]
, (*791)
toString(string $separator): string
â
Implodes array to a string with specified separator., (*792)
Parameters:
- string $separator [optional] <p>The element's separator.</p>
, (*793)
Return:
- string <p>The string representation of array, separated by ",".</p>
, (*794)
uasort(callable $callable): $this
â
Sort the entries with a user-defined comparison function and maintain key association., (*795)
Parameters:
- callable $callable
, (*796)
Return:
- $this <p>(Mutable) Return this Arrayy object.</p>
, (*797)
uasortImmutable(callable $callable): $this
â
Sort the entries with a user-defined comparison function and maintain key association., (*798)
Parameters:
- callable $callable
, (*799)
Return:
- $this <p>(Immutable) Return this Arrayy object.</p>
, (*800)
uksort(callable $callable): static
â
Sort the entries by keys using a user-defined comparison function., (*801)
Parameters:
- callable $callable
, (*802)
Return:
- static <p>(Mutable) Return this Arrayy object.</p>
, (*803)
uksortImmutable(callable $callable): static
â
Sort the entries by keys using a user-defined comparison function., (*804)
Parameters:
- callable $callable
, (*805)
Return:
- static <p>(Immutable) Return this Arrayy object.</p>
, (*806)
unique(): static
â
alias: for "Arrayy->uniqueNewIndex()", (*807)
Parameters:
nothing, (*808)
Return:
- static <p>(Mutable) Return this Arrayy object, with the appended values.</p>
, (*809)
uniqueKeepIndex(): $this
â
Return a duplicate free copy of the current array. (with the old keys), (*810)
EXAMPLE:
a([2 => 1, 3 => 2, 4 => 2])->uniqueNewIndex(); // Arrayy[2 => 1, 3 => 2]
, (*811)
Parameters:
nothing, (*812)
Return:
- $this <p>(Mutable)</p>
, (*813)
uniqueNewIndex(): $this
â
Return a duplicate free copy of the current array., (*814)
EXAMPLE:
a([2 => 1, 3 => 2, 4 => 2])->uniqueNewIndex(); // Arrayy[1, 2]
, (*815)
Parameters:
nothing, (*816)
Return:
- $this <p>(Mutable)</p>
, (*817)
unserialize(string $string): $this
â
Unserialize an string and return the instance of the "Arrayy"-class., (*818)
EXAMPLE:
$serialized = a([1, 4, 7])->serialize();
a()->unserialize($serialized);
, (*819)
Parameters:
- string $string
, (*820)
Return:
- $this
, (*821)
unshift(mixed $args): $this
â
Prepends one or more values to the beginning of array at once., (*822)
Parameters:
- array<TKey, T> ...$args
, (*823)
Return:
- $this <p>(Mutable) Return this Arrayy object, with prepended elements to the beginning of array.</p>
, (*824)
validate(\Closure $closure): bool
â
Tests whether the given closure return something valid for all elements of this array., (*825)
Parameters:
- \Closure(T , TKey ): bool $closure the predicate
, (*826)
Return:
- bool <p>TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.</p>
, (*827)
values(): static
â
Get all values from a array., (*828)
EXAMPLE:
$arrayy = a([1 => 'foo', 2 => 'foo2', 3 => 'bar']);
$arrayyTmp->values(); // Arrayy[0 => 'foo', 1 => 'foo2', 2 => 'bar']
, (*829)
Parameters:
nothing, (*830)
Return:
- static <p>(Immutable)</p>
, (*831)
walk(callable $callable, bool $recursive, mixed $userData): $this
â
Apply the given function to every element in the array, discarding the results., (*832)
EXAMPLE:
$callable = function (&$value, $key) {
$value = $key;
};
$arrayy = a([1, 2, 3]);
$arrayy->walk($callable); // Arrayy[0, 1, 2]
, (*833)
Parameters:
- callable $callable
- bool $recursive [optional] <p>Whether array will be walked recursively or no</p>
- mixed $userData [optional] <p>
If the optional $userData parameter is supplied,
it will be passed as the third parameter to the $callable.
</p>
, (*834)
Return:
- $this <p>(Mutable) Return this Arrayy object, with modified elements.</p>
, (*835)
where(string $keyOrPropertyOrMethod, mixed $value): static
â
Returns a collection of matching items., (*836)
Parameters:
- string $keyOrPropertyOrMethod <p>The property or method to evaluate.</p>
- mixed $value <p>The value to match.</p>
, (*837)
Return:
- static
, (*838)
, (*839)
append(null|mixed $value):
â, (*840)
Parameters:
- null|mixed $value
, (*841)
Return:
- TODO: __not_detected__
, (*842)
asort(int $flags):
â, (*843)
Parameters:
- int $flags
, (*844)
Return:
- TODO: __not_detected__
, (*845)
count():
â, (*846)
Parameters:
nothing, (*847)
Return:
- TODO: __not_detected__
, (*848)
exchangeArray(array|object $array):
â, (*849)
Parameters:
- array|object $array
, (*850)
Return:
- TODO: __not_detected__
, (*851)
getArrayCopy():
â, (*852)
Parameters:
nothing, (*853)
Return:
- TODO: __not_detected__
, (*854)
getFlags():
â, (*855)
Parameters:
nothing, (*856)
Return:
- TODO: __not_detected__
, (*857)
getIterator():
â, (*858)
Parameters:
nothing, (*859)
Return:
- TODO: __not_detected__
, (*860)
getIteratorClass():
â, (*861)
Parameters:
nothing, (*862)
Return:
- TODO: __not_detected__
, (*863)
ksort(int $flags):
â, (*864)
Parameters:
- int $flags
, (*865)
Return:
- TODO: __not_detected__
, (*866)
natcasesort():
â, (*867)
Parameters:
nothing, (*868)
Return:
- TODO: __not_detected__
, (*869)
natsort():
â, (*870)
Parameters:
nothing, (*871)
Return:
- TODO: __not_detected__
, (*872)
offsetExists(null|mixed $key):
â, (*873)
Parameters:
- null|mixed $key
, (*874)
Return:
- TODO: __not_detected__
, (*875)
offsetGet(null|mixed $key):
â, (*876)
Parameters:
- null|mixed $key
, (*877)
Return:
- TODO: __not_detected__
, (*878)
offsetSet(null|mixed $key, null|mixed $value):
â, (*879)
Parameters:
- null|mixed $key
- null|mixed $value
, (*880)
Return:
- TODO: __not_detected__
, (*881)
offsetUnset(null|mixed $key):
â, (*882)
Parameters:
- null|mixed $key
, (*883)
Return:
- TODO: __not_detected__
, (*884)
serialize():
â, (*885)
Parameters:
nothing, (*886)
Return:
- TODO: __not_detected__
, (*887)
setFlags(int $flags):
â, (*888)
Parameters:
- int $flags
, (*889)
Return:
- TODO: __not_detected__
, (*890)
setIteratorClass(string $iteratorClass):
â, (*891)
Parameters:
- string $iteratorClass
, (*892)
Return:
- TODO: __not_detected__
, (*893)
uasort(callable $callback):
â, (*894)
Parameters:
- callable $callback
, (*895)
Return:
- TODO: __not_detected__
, (*896)
uksort(callable $callback):
â, (*897)
Parameters:
- callable $callback
, (*898)
Return:
- TODO: __not_detected__
, (*899)
unserialize(string $data):
â, (*900)
Parameters:
- string $data
, (*901)
Return:
- TODO: __not_detected__
, (*902)
Support
For support and donations please visit Github | Issues | PayPal | Patreon., (*903)
For status updates and release announcements please visit Releases | Twitter | Patreon., (*904)
For professional support please contact me., (*905)
Thanks
- Thanks to GitHub (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
- Thanks to IntelliJ as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to Travis CI for being the most awesome, easiest continous integration tool out there!
- Thanks to StyleCI for the simple but powerfull code style check.
- Thanks to PHPStan && Psalm for relly great Static analysis tools and for discover bugs in the code!
Tests
From the project directory, tests can be ran using phpunit
, (*906)
License
Released under the MIT License - see LICENSE.txt
for details., (*907)