{"id":33999995,"url":"https://github.com/lodash-php/lodash-php","last_synced_at":"2025-12-13T09:10:28.485Z","repository":{"id":42382769,"uuid":"114683570","full_name":"lodash-php/lodash-php","owner":"lodash-php","description":"Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP","archived":false,"fork":false,"pushed_at":"2024-08-18T11:48:20.000Z","size":470,"stargazers_count":521,"open_issues_count":9,"forks_count":54,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-07-12T14:03:03.047Z","etag":null,"topics":["lodash","php","php-library","php-utility","utilities","utility","utility-library"],"latest_commit_sha":null,"homepage":"https://lodash-php.github.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lodash-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-18T20:14:28.000Z","updated_at":"2025-07-11T07:46:50.000Z","dependencies_parsed_at":"2023-12-17T17:30:47.296Z","dependency_job_id":"a2fb7524-3cf8-419f-b99e-a1212fd84008","html_url":"https://github.com/lodash-php/lodash-php","commit_stats":{"total_commits":203,"total_committers":4,"mean_commits":50.75,"dds":"0.024630541871921152","last_synced_commit":"fb7d6d76c1e0703830b8879c2cfb4b1c2e0caed3"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/lodash-php/lodash-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodash-php%2Flodash-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodash-php%2Flodash-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodash-php%2Flodash-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodash-php%2Flodash-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lodash-php","download_url":"https://codeload.github.com/lodash-php/lodash-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lodash-php%2Flodash-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27702934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lodash","php","php-library","php-utility","utilities","utility","utility-library"],"created_at":"2025-12-13T09:10:27.645Z","updated_at":"2025-12-13T09:10:28.472Z","avatar_url":"https://github.com/lodash-php.png","language":"PHP","readme":"# Lodash-PHP\n\nLodash-PHP is a port of the [Lodash JS library](https://lodash.com/) to PHP. It is a set of easy to use utility functions for everyday PHP projects.\n\nLodash-PHP tries to mimick lodash.js as close as possible\n\n# Requirements\n\nLodash-PHP requires minimum PHP 7.2+, but the latest version of PHP is always recommended.\n\n# Installation\n\nInstall Lodash-PHP through composer:\n\n```bash\n$ composer require lodash-php/lodash-php\n```\n\n# Usage\n\nEach method in Lodash-PHP is a separate function that can be imported and used on it's own.\n\n```php\n\u003c?php\n\nuse function _\\each;\n\neach([1, 2, 3], function (int $item) {\n    var_dump($item);\n});\n```\n\nLodash-PHP also comes with a global `_` class that can be used globally.\n\n```php\n\u003c?php\n\n_::each([1, 2, 3], function (int $item) {\n    var_dump($item);\n});\n```\n\n# Methods\n- [Array](#array)\n- [Collection](#collection)\n- [Date](#date)\n- [Function](#function)\n- [Lang](#lang)\n- [Math](#math)\n- [Number](#number)\n- [Object](#object)\n- [Seq](#seq)\n- [String](#string)\n- [Util](#util)\n\n## Array\n\n### chunk\n\nCreates an array of elements split into groups the length of `size`.\nIf `array` can't be split evenly, the final chunk will be the remaining\nelements.\n\n\n\n\n**Arguments:**\n\n@param array $array array The array to process.\n\n@param int $number [size=1] The length of each chunk\n\n\n\n**Return:**\n\n@return array Returns the new array of chunks.\n\nExample:\n```php\n\u003c?php\n use function _\\chunk;\n\nchunk(['a', 'b', 'c', 'd'], 2)\n// =\u003e [['a', 'b'], ['c', 'd']]\n\nchunk(['a', 'b', 'c', 'd'], 3)\n// =\u003e [['a', 'b', 'c'], ['d']]\n\n```\n### compact\n\nCreates an array with all falsey values removed. The values `false`, `null`,\n`0`, `\"\"`, `undefined`, and `NaN` are falsey.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to compact.\n\n\n\n**Return:**\n\n@return array Returns the new array of filtered values.\n\nExample:\n```php\n\u003c?php\n use function _\\compact;\n\ncompact([0, 1, false, 2, '', 3])\n// =\u003e [1, 2, 3]\n\n```\n### concat\n\nCreates a new array concatenating `array` with any additional arrays\nand/or values.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to concatenate.\n\n@param array\u003cint, mixed\u003e $values The values to concatenate.\n\n\n\n**Return:**\n\n@return array Returns the new concatenated array.\n\nExample:\n```php\n\u003c?php\n use function _\\concat;\n\n$array = [1];\n$other = concat($array, 2, [3], [[4]]);\n\nvar_dump($other)\n// =\u003e [1, 2, 3, [4]]\n\nvar_dump($array)\n// =\u003e [1]\n\n```\n### difference\n\nCreates an array of `array` values not included in the other given arrays\nusing [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons. The order and references of result values are\ndetermined by the first array.\n\n**Note:** Unlike `pullAll`, this method returns a new array.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param array ...$values The values to exclude.\n\n\n\n**Return:**\n\n@return array Returns the new array of filtered values.\n\nExample:\n```php\n\u003c?php\n use function _\\difference;\n\ndifference([2, 1], [2, 3])\n// =\u003e [1]\n\n```\n### differenceBy\n\nThis method is like `difference` except that it accepts `iteratee` which\nis invoked for each element of `array` and `values` to generate the criterion\nby which they're compared. The order and references of result values are\ndetermined by the first array. The iteratee is invoked with one argument:\n(value).\n\n**Note:** Unlike `pullAllBy`, this method returns a new array.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param array\u003cint, mixed\u003e ...$values The values to exclude.\n\n@param callable $iteratee The iteratee invoked per element.\n\n\n\n**Return:**\n\n@return array Returns the new array of filtered values.\n\nExample:\n```php\n\u003c?php\n use function _\\differenceBy;\n\ndifferenceBy([2.1, 1.2], [2.3, 3.4], 'floor')\n// =\u003e [1.2]\n\n```\n### differenceWith\n\nThis method is like `difference` except that it accepts `comparator`\nwhich is invoked to compare elements of `array` to `values`. The order and\nreferences of result values are determined by the first array. The comparator\nis invoked with two arguments: (arrVal, othVal).\n\n**Note:** Unlike `pullAllWith`, this method returns a new array.\n\n\n\n\n\n\n**Arguments:**\n\n@param array\u003cint, mixed\u003e $array The array to inspect.\n\n@param array ...$values The values to exclude.\n\n@param callable $comparator The comparator invoked per element.\n\n\n\n**Return:**\n\n@return array Returns the new array of filtered values.\n\nExample:\n```php\n\u003c?php\n use function _\\differenceWith;\n\n$objects = [[ 'x' =\u003e 1, 'y' =\u003e 2 ], [ 'x' =\u003e 2, 'y' =\u003e 1 ]]\n\ndifferenceWith($objects, [[ 'x' =\u003e 1, 'y' =\u003e 2 ]], '_::isEqual')\n// =\u003e [[ 'x' =\u003e 2, 'y' =\u003e 1 ]]\n\n```\n### drop\n\nCreates a slice of `array` with `n` elements dropped from the beginning.\n\n**NOTE:** This function will reorder and reset the array indices\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param int $n The number of elements to drop.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\drop;\n\ndrop([1, 2, 3])\n// =\u003e [2, 3]\n\ndrop([1, 2, 3], 2)\n// =\u003e [3]\n\ndrop([1, 2, 3], 5)\n// =\u003e []\n\ndrop([1, 2, 3], 0)\n// =\u003e [1, 2, 3]\n\n```\n### dropRight\n\nCreates a slice of `array` with `n` elements dropped from the end.\n**NOTE:** This function will reorder and reset the array indices\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param int $n The number of elements to drop.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\dropRight;\n\ndropRight([1, 2, 3])\n// =\u003e [1, 2]\n\ndropRight([1, 2, 3], 2)\n// =\u003e [1]\n\ndropRight([1, 2, 3], 5)\n// =\u003e []\n\ndropRight([1, 2, 3], 0)\n// =\u003e [1, 2, 3]\n\n```\n### dropRightWhile\n\nCreates a slice of `array` excluding elements dropped from the end.\nElements are dropped until `predicate` returns falsey. The predicate is\ninvoked with three arguments: (value, index, array).\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\dropRightWhile;\n\n$users = [\n[ 'user' =\u003e 'barney',  'active' =\u003e false ],\n[ 'user' =\u003e 'fred',    'active' =\u003e true ],\n[ 'user' =\u003e 'pebbles', 'active' =\u003e true ]\n]\n\ndropRightWhile($users, function($user) { return $user['active']; })\n// =\u003e objects for ['barney']\n\n```\n### dropWhile\n\nCreates a slice of `array` excluding elements dropped from the beginning.\nElements are dropped until `predicate` returns falsey. The predicate is\ninvoked with three arguments: (value, index, array).\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\dropWhile;\n\n$users = [\n[ 'user' =\u003e 'barney',  'active' =\u003e true ],\n[ 'user' =\u003e 'fred',    'active' =\u003e true ],\n[ 'user' =\u003e 'pebbles', 'active' =\u003e false ]\n]\n\ndropWhile($users, function($user) { return $user['active']; } )\n// =\u003e objects for ['pebbles']\n\n```\n### every\n\nChecks if `predicate` returns truthy for **all** elements of `array`.\nIteration is stopped once `predicate` returns falsey. The predicate is\ninvoked with three arguments: (value, index, array).\n\n**Note:** This method returns `true` for\n[empty arrays](https://en.wikipedia.org/wiki/Empty_set) because\n[everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\nelements of empty arrays.\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The array to iterate over.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return bool `true` if all elements pass the predicate check, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\every;\n\nevery([true, 1, null, 'yes'], function ($value) { return is_bool($value);})\n// =\u003e false\n\n$users = [\n['user' =\u003e 'barney', 'age' =\u003e 36, 'active' =\u003e false],\n['user' =\u003e 'fred', 'age' =\u003e 40, 'active' =\u003e false],\n];\n\n// The `matches` iteratee shorthand.\n$this-\u003eassertFalse(every($users, ['user' =\u003e 'barney', 'active' =\u003e false]));\n// false\n\n// The `matchesProperty` iteratee shorthand.\n$this-\u003eassertTrue(every($users, ['active', false]));\n// true\n\n// The `property` iteratee shorthand.\n$this-\u003eassertFalse(every($users, 'active'));\n//false\n\n\n```\n### findIndex\n\nThis method is like `find` except that it returns the index of the first element predicate returns truthy for instead of the element itself.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param callable $predicate The function invoked per iteration.\n\n@param int $fromIndex The index to search from.\n\n\n\n**Return:**\n\n@return int the index of the found element, else `-1`.\n\nExample:\n```php\n\u003c?php\n use function _\\findIndex;\n\n$users = [\n['user' =\u003e 'barney',  'active' =\u003e false],\n['user' =\u003e 'fred',    'active' =\u003e false],\n['user' =\u003e 'pebbles', 'active' =\u003e true],\n];\n\nfindIndex($users, function($o) { return $o['user'] s== 'barney'; });\n// =\u003e 0\n\n// The `matches` iteratee shorthand.\nfindIndex($users, ['user' =\u003e 'fred', 'active' =\u003e false]);\n// =\u003e 1\n\n// The `matchesProperty` iteratee shorthand.\nfindIndex($users, ['active', false]);\n// =\u003e 0\n\n// The `property` iteratee shorthand.\nfindIndex($users, 'active');\n// =\u003e 2\n\n```\n### findLastIndex\n\nThis method is like `findIndex` except that it iterates over elements\nof `collection` from right to left.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param mixed $predicate The function invoked per iteration.\n\n@param int $fromIndex The index to search from.\n\n\n\n**Return:**\n\n@return int the index of the found element, else `-1`.\n\nExample:\n```php\n\u003c?php\n use function _\\findLastIndex;\n\n$users = [\n['user' =\u003e 'barney',  'active' =\u003e true ],\n['user' =\u003e 'fred',    'active' =\u003e false ],\n['user' =\u003e 'pebbles', 'active' =\u003e false ]\n]\n\nfindLastIndex($users, function($user) { return $user['user'] === 'pebbles'; })\n// =\u003e 2\n\n```\n### flatten\n\nFlattens `array` a single level deep.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to flatten.\n\n\n\n**Return:**\n\n@return array the new flattened array.\n\nExample:\n```php\n\u003c?php\n use function _\\flatten;\n\nflatten([1, [2, [3, [4]], 5]])\n// =\u003e [1, 2, [3, [4]], 5]\n\n```\n### flattenDeep\n\nRecursively flattens `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to flatten.\n\n\n\n**Return:**\n\n@return array Returns the new flattened array.\n\nExample:\n```php\n\u003c?php\n use function _\\flattenDeep;\n\nflattenDeep([1, [2, [3, [4]], 5]]);\n// =\u003e [1, 2, 3, 4, 5]\n\n```\n### flattenDepth\n\nRecursively flatten `array` up to `depth` times.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to flatten.\n\n@param int $depth The maximum recursion depth.\n\n\n\n**Return:**\n\n@return array the new flattened array.\n\nExample:\n```php\n\u003c?php\n use function _\\flattenDepth;\n\n$array = [1, [2, [3, [4]], 5]]\n\nflattenDepth($array, 1)\n// =\u003e [1, 2, [3, [4]], 5]\n\nflattenDepth($array, 2)\n// =\u003e [1, 2, 3, [4], 5]\n\n```\n### fromPairs\n\nThe inverse of `toPairs`, this method returns an object composed\nfrom key-value `pairs`.\n\n\n\n\n\n**Arguments:**\n\n@param array $pairs The key-value pairs.\n\n\n\n**Return:**\n\n@return \\stdClass the new object.\n\nExample:\n```php\n\u003c?php\n use function _\\fromPairs;\n\nfromPairs([['a', 1], ['b', 2]])\n// =\u003e stdClass(\n// 'a' =\u003e 1,\n//'b' =\u003e 2,\n// )\n\n```\n### head\n\nGets the first element of `array`.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n\n\n**Return:**\n\n@return mixed Returns the first element of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\head;\n\nhead([1, 2, 3])\n// =\u003e 1\n\nhead([])\n// =\u003e null\n\n```\n### indexOf\n\nGets the index at which the first occurrence of `value` is found in `array`\nusing [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons. If `fromIndex` is negative, it's used as the\noffset from the end of `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param mixed $value The value to search for.\n\n@param int $fromIndex The index to search from.\n\n\n\n**Return:**\n\n@return int the index of the matched value, else `-1`.\n\nExample:\n```php\n\u003c?php\n use function _\\indexOf;\n\nindexOf([1, 2, 1, 2], 2)\n// =\u003e 1\n\n// Search from the `fromIndex`.\nindexOf([1, 2, 1, 2], 2, 2)\n// =\u003e 3\n\n```\n### initial\n\nGets all but the last element of `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\initial;\n\ninitial([1, 2, 3])\n// =\u003e [1, 2]\n\n```\n### intersection\n\nCreates an array of unique values that are included in all given arrays\nusing [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons. The order and references of result values are\ndetermined by the first array.\n\n\n\n\n\n**Arguments:**\n\n@param array ...$arrays\n\n\n\n**Return:**\n\n@return array the new array of intersecting values.\n\nExample:\n```php\n\u003c?php\n use function _\\intersection;\n\nintersection([2, 1], [2, 3])\n// =\u003e [2]\n\n```\n### intersectionBy\n\nThis method is like `intersection` except that it accepts `iteratee`\nwhich is invoked for each element of each `arrays` to generate the criterion\nby which they're compared. The order and references of result values are\ndetermined by the first array. The iteratee is invoked with one argument:\n(value).\n\n\n\n\n**Arguments:**\n\n@param array\u003cint, mixed\u003e ...$arrays\n\n@param callable $iteratee The iteratee invoked per element.\n\n\n\n**Return:**\n\n@return array the new array of intersecting values.\n\nExample:\n```php\n\u003c?php\n use function _\\intersectionBy;\n\nintersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)\n// =\u003e [2.1]\n\n// The `property` iteratee shorthand.\nintersectionBy([[ 'x' =\u003e 1 ]], [[ 'x' =\u003e 2 ], [ 'x' =\u003e 1 ]], 'x');\n// =\u003e [[ 'x' =\u003e 1 ]]\n\n```\n### intersectionWith\n\nThis method is like `intersection` except that it accepts `comparator`\nwhich is invoked to compare elements of `arrays`. The order and references\nof result values are determined by the first array. The comparator is\ninvoked with two arguments: (arrVal, othVal).\n\n\n\n\n\n**Arguments:**\n\n@param array ...$arrays\n\n@param callable $comparator The comparator invoked per element.\n\n\n\n**Return:**\n\n@return array the new array of intersecting values.\n\nExample:\n```php\n\u003c?php\n use function _\\intersectionWith;\n\n$objects = [[ 'x' =\u003e 1, 'y' =\u003e 2 ], [ 'x' =\u003e 2, 'y' =\u003e 1 ]]\n$others = [[ 'x' =\u003e 1, 'y' =\u003e 1 ], [ 'x' =\u003e 1, 'y' =\u003e 2 ]]\n\nintersectionWith($objects, $others, '_::isEqual')\n// =\u003e [[ 'x' =\u003e 1, 'y' =\u003e 2 ]]\n\n```\n### last\n\nGets the last element of `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n\n\n**Return:**\n\n@return mixed Returns the last element of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\last;\n\nlast([1, 2, 3])\n// =\u003e 3\n\n```\n### lastIndexOf\n\nThis method is like `indexOf` except that it iterates over elements of\n`array` from right to left.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param mixed $value The value to search for.\n\n@param int $fromIndex The index to search from.\n\n\n\n**Return:**\n\n@return int the index of the matched value, else `-1`.\n\nExample:\n```php\n\u003c?php\n use function _\\lastIndexOf;\n\nlastIndexOf([1, 2, 1, 2], 2)\n// =\u003e 3\n\n// Search from the `fromIndex`.\nlastIndexOf([1, 2, 1, 2], 2, 2)\n// =\u003e 1\n\n```\n### nth\n\nGets the element at index `n` of `array`. If `n` is negative, the nth\nelement from the end is returned.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param int $n The index of the element to return.\n\n\n\n**Return:**\n\n@return mixed Returns the nth element of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\nth;\n\n$array = ['a', 'b', 'c', 'd']\n\nnth($array, 1)\n// =\u003e 'b'\n\nnth($array, -2)\n// =\u003e 'c'\n\n```\n### pull\n\nRemoves all given values from `array` using\n[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons.\n\n**Note:** Unlike `without`, this method mutates `array`. Use `remove`\nto remove elements from an array by predicate.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to modify.\n\n@param array\u003cint, string\u003e $values The values to remove.\n\n\n\n**Return:**\n\n@return array\n\nExample:\n```php\n\u003c?php\n use function _\\pull;\n\n$array = ['a', 'b', 'c', 'a', 'b', 'c']\n\npull($array, 'a', 'c')\nvar_dump($array)\n// =\u003e ['b', 'b']\n\n```\n### pullAll\n\nThis method is like `pull` except that it accepts an array of values to remove.\n\n**Note:** Unlike `difference`, this method mutates `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to modify.\n\n@param array $values The values to remove.\n\n\n\n**Return:**\n\n@return array `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\pullAll;\n\n$array = ['a', 'b', 'c', 'a', 'b', 'c']\n\npullAll($array, ['a', 'c'])\nvar_dump($array)\n// =\u003e ['b', 'b']\n\n```\n### pullAllBy\n\nThis method is like `pullAll` except that it accepts `iteratee` which is\ninvoked for each element of `array` and `values` to generate the criterion\nby which they're compared. The iteratee is invoked with one argument: (value).\n\n**Note:** Unlike `differenceBy`, this method mutates `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to modify.\n\n@param array $values The values to remove.\n\n@param callable $iteratee The iteratee invoked per element.\n\n\n\n**Return:**\n\n@return array `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\pullAllBy;\n\n$array = [[ 'x' =\u003e 1 ], [ 'x' =\u003e 2 ], [ 'x' =\u003e 3 ], [ 'x' =\u003e 1 ]]\n\npullAllBy($array, [[ 'x' =\u003e 1 ], [ 'x' =\u003e 3 ]], 'x')\nvar_dump($array)\n// =\u003e [[ 'x' =\u003e 2 ]]\n\n```\n### pullAllWith\n\nThis method is like `pullAll` except that it accepts `comparator` which\nis invoked to compare elements of `array` to `values`. The comparator is\ninvoked with two arguments: (arrVal, othVal).\n\n**Note:** Unlike `differenceWith`, this method mutates `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to modify.\n\n@param array $values The values to remove.\n\n@param callable $comparator The comparator invoked per element.\n\n\n\n**Return:**\n\n@return array `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\pullAllWith;\n\n$array = [[ 'x' =\u003e 1, 'y' =\u003e 2 ], [ 'x' =\u003e 3, 'y' =\u003e 4 ], [ 'x' =\u003e 5, 'y' =\u003e 6 ]]\n\npullAllWith($array, [[ 'x' =\u003e 3, 'y' =\u003e 4 ]], '_\\isEqual')\nvar_dump($array)\n// =\u003e [[ 'x' =\u003e 1, 'y' =\u003e 2 ], [ 'x' =\u003e 5, 'y' =\u003e 6 ]]\n\n```\n### pullAt\n\nRemoves elements from `array` corresponding to `indexes` and returns an\narray of removed elements.\n\n**Note:** Unlike `at`, this method mutates `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to modify.\n\n@param (int | int[]) $indexes The indexes of elements to remove.\n\n\n\n**Return:**\n\n@return array the new array of removed elements.\n\nExample:\n```php\n\u003c?php\n use function _\\pullAt;\n\n$array = ['a', 'b', 'c', 'd']\n$pulled = pullAt($array, [1, 3])\n\nvar_dump($array)\n// =\u003e ['a', 'c']\n\nvar_dump($pulled)\n// =\u003e ['b', 'd']\n\n```\n### remove\n\nRemoves all elements from `array` that `predicate` returns truthy for\nand returns an array of the removed elements. The predicate is invoked\nwith three arguments: (value, index, array).\n\n**Note:** Unlike `filter`, this method mutates `array`. Use `pull`\nto pull elements from an array by value.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to modify.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the new array of removed elements.\n\nExample:\n```php\n\u003c?php\n use function _\\remove;\n\n$array = [1, 2, 3, 4]\n$evens = remove($array, function ($n) { return $n % 2 === 0; })\n\nvar_dump($array)\n// =\u003e [1, 3]\n\nvar_dump($evens)\n// =\u003e [2, 4]\n\n```\n### sample\n\nGets a random element from `array`.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to sample.\n\n\n\n**Return:**\n\n@return mixed Returns the random element.\n\nExample:\n```php\n\u003c?php\n use function _\\sample;\n\nsample([1, 2, 3, 4])\n// =\u003e 2\n\n```\n### sampleSize\n\nGets `n` random elements at unique keys from `array` up to the\nsize of `array`.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to sample.\n\n@param int $n The number of elements to sample.\n\n\n\n**Return:**\n\n@return array the random elements.\n\nExample:\n```php\n\u003c?php\n use function _\\sampleSize;\n\nsampleSize([1, 2, 3], 2)\n// =\u003e [3, 1]\n\nsampleSize([1, 2, 3], 4)\n// =\u003e [2, 3, 1]\n\n```\n### shuffle\n\nCreates an array of shuffled values\n\n\n\n\n**Arguments:**\n\n@param array $array The array to shuffle.\n\n\n\n**Return:**\n\n@return array the new shuffled array.\n\nExample:\n```php\n\u003c?php\n use function _\\shuffle;\n\nshuffle([1, 2, 3, 4])\n// =\u003e [4, 1, 3, 2]\n\n```\n### slice\n\nCreates a slice of `array` from `start` up to, but not including, `end`.\n\n\n\n**Arguments:**\n\n@param array $array The array to slice.\n\n@param int $start The start position.\n\n@param int $end The end position.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\n### tail\n\nGets all but the first element of `array`.\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\tail;\n\ntail([1, 2, 3])\n// =\u003e [2, 3]\n\n```\n### take\n\nCreates a slice of `array` with `n` elements taken from the beginning.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param int $n The number of elements to take.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\take;\n\ntake([1, 2, 3])\n// =\u003e [1]\n\ntake([1, 2, 3], 2)\n// =\u003e [1, 2]\n\ntake([1, 2, 3], 5)\n// =\u003e [1, 2, 3]\n\ntake([1, 2, 3], 0)\n// =\u003e []\n\n```\n### takeRight\n\nCreates a slice of `array` with `n` elements taken from the end.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param int $n The number of elements to take.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\takeRight;\n\ntakeRight([1, 2, 3])\n// =\u003e [3]\n\ntakeRight([1, 2, 3], 2)\n// =\u003e [2, 3]\n\ntakeRight([1, 2, 3], 5)\n// =\u003e [1, 2, 3]\n\ntakeRight([1, 2, 3], 0)\n// =\u003e []\n\n```\n### takeRightWhile\n\nCreates a slice of `array` with elements taken from the end. Elements are\ntaken until `predicate` returns falsey. The predicate is invoked with\nthree arguments: (value, index, array).\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\takeRightWhile;\n\n$users = [\n[ 'user' =\u003e 'barney',  'active' =\u003e false ],\n[ 'user' =\u003e 'fred',    'active' =\u003e true ],\n[ 'user' =\u003e 'pebbles', 'active' =\u003e true ]\n];\n\ntakeRightWhile($users, function($value) { return $value['active']; })\n// =\u003e objects for ['fred', 'pebbles']\n\n```\n### takeWhile\n\nCreates a slice of `array` with elements taken from the beginning. Elements\nare taken until `predicate` returns falsey. The predicate is invoked with\nthree arguments: (value, index, array).\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array to query.\n\n@param mixed $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the slice of `array`.\n\nExample:\n```php\n\u003c?php\n use function _\\takeWhile;\n\n$users = [\n[ 'user' =\u003e 'barney',  'active' =\u003e true ],\n[ 'user' =\u003e 'fred',    'active' =\u003e true ],\n[ 'user' =\u003e 'pebbles', 'active' =\u003e false ]\n]\n\ntakeWhile($users, function($value) { return $value['active']; })\n// =\u003e objects for ['barney', 'fred']\n\n```\n### union\n\nCreates an array of unique values, in order, from all given arrays using\n[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons.\n\n\n\n\n\n**Arguments:**\n\n@param array ...$arrays The arrays to inspect.\n\n\n\n**Return:**\n\n@return array the new array of combined values.\n\nExample:\n```php\n\u003c?php\n use function _\\union;\n\nunion([2], [1, 2])\n// =\u003e [2, 1]\n\n```\n### unionBy\n\nThis method is like `union` except that it accepts `iteratee` which is\ninvoked for each element of each `arrays` to generate the criterion by\nwhich uniqueness is computed. Result values are chosen from the first\narray in which the value occurs. The iteratee is invoked with one argument:\n(value).\n\n\n\n\n\n**Arguments:**\n\n@param array\u003cint, mixed\u003e ...$arrays The arrays to inspect.\n\n@param callable $iteratee The iteratee invoked per element.\n\n\n\n**Return:**\n\n@return array the new array of combined values.\n\nExample:\n```php\n\u003c?php\n use function _\\unionBy;\n\nunionBy([2.1], [1.2, 2.3], 'floor')\n// =\u003e [2.1, 1.2]\n\n// The `_::property` iteratee shorthand.\nunionBy([['x' =\u003e 1]], [['x' =\u003e 2], ['x' =\u003e 1]], 'x');\n// =\u003e [['x' =\u003e 1], ['x' =\u003e 2]]\n\n```\n### unionWith\n\nThis method is like `union` except that it accepts `comparator` which\nis invoked to compare elements of `arrays`. Result values are chosen from\nthe first array in which the value occurs. The comparator is invoked\nwith two arguments: (arrVal, othVal).\n\n\n\n\n\n\n**Arguments:**\n\n@param array\u003cint, mixed\u003e ...$arrays The arrays to inspect.\n\n@param callable $comparator The comparator invoked per element.\n\n\n\n**Return:**\n\n@return array the new array of combined values.\n\nExample:\n```php\n\u003c?php\n use function _\\unionWith;\n\n$objects = [['x' =\u003e 1, 'y' =\u003e 2], ['x' =\u003e 2, 'y' =\u003e 1]]\n$others = [['x' =\u003e 1, 'y' =\u003e 1], ['x' =\u003e 1, 'y' =\u003e 2]]\n\nunionWith($objects, $others, '_::isEqual')\n// =\u003e [['x' =\u003e 1, 'y' =\u003e 2], ['x' =\u003e 2, 'y' =\u003e 1], ['x' =\u003e 1, 'y' =\u003e 1]]\n\n```\n### uniq\n\nCreates a duplicate-free version of an array, using\n[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons, in which only the first occurrence of each element\nis kept. The order of result values is determined by the order they occur\nin the array.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n\n\n**Return:**\n\n@return array the new duplicate free array.\n\nExample:\n```php\n\u003c?php\n use function _\\uniq;\n\nuniq([2, 1, 2])\n// =\u003e [2, 1]s\n\n```\n### uniqBy\n\nThis method is like `uniq` except that it accepts `iteratee` which is\ninvoked for each element in `array` to generate the criterion by which\nuniqueness is computed. The order of result values is determined by the\norder they occur in the array. The iteratee is invoked with one argument:\n(value).\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param mixed $iteratee The iteratee invoked per element.\n\n\n\n**Return:**\n\n@return array the new duplicate free array.\n\nExample:\n```php\n\u003c?php\n use function _\\uniqBy;\n\nuniqBy([2.1, 1.2, 2.3], 'floor')\n// =\u003e [2.1, 1.2]\n\n```\n### uniqWith\n\nThis method is like `uniq` except that it accepts `comparator` which\nis invoked to compare elements of `array`. The order of result values is\ndetermined by the order they occur in the array.The comparator is invoked\nwith two arguments: (arrVal, othVal).\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param callable $comparator The comparator invoked per element.\n\n\n\n**Return:**\n\n@return array the new duplicate free array.\n\nExample:\n```php\n\u003c?php\n use function _\\uniqWith;\n\n$objects = [['x' =\u003e 1, 'y' =\u003e 2], ['x' =\u003e 2, 'y' =\u003e 1], ['x' =\u003e 1, 'y' =\u003e 2]]\n\nuniqWith($objects, '_::isEqual')\n// =\u003e [['x' =\u003e 1, 'y' =\u003e 2], ['x' =\u003e 2, 'y' =\u003e 1]]\n\n```\n### unzip\n\nThis method is like `zip` except that it accepts an array of grouped\nelements and creates an array regrouping the elements to their pre-zip\nconfiguration.\n\n\n\n\n**Arguments:**\n\n@param array $array The array of grouped elements to process.\n\n\n\n**Return:**\n\n@return array the new array of regrouped elements.\n\nExample:\n```php\n\u003c?php\n use function _\\unzip;\n\n$zipped = zip(['a', 'b'], [1, 2], [true, false])\n// =\u003e [['a', 1, true], ['b', 2, false]]\n\nunzip($zipped)\n// =\u003e [['a', 'b'], [1, 2], [true, false]]\n\n```\n### unzipWith\n\nThis method is like `unzip` except that it accepts `iteratee` to specify\nhow regrouped values should be combined. The iteratee is invoked with the\nelements of each group: (...group).\n\n\n\n\n\n**Arguments:**\n\n@param array $array The array of grouped elements to process.\n\n@param (callable | null) $iteratee The function to combine regrouped values.\n\n\n\n**Return:**\n\n@return array the new array of regrouped elements.\n\nExample:\n```php\n\u003c?php\n use function _\\unzipWith;\n\n$zipped = zip([1, 2], [10, 20], [100, 200])\n// =\u003e [[1, 10, 100], [2, 20, 200]]\n\nunzipWith(zipped, '_::add')\n// =\u003e [3, 30, 300]\n\n```\n### without\n\nCreates an array excluding all given values using\n[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\nfor equality comparisons.\n\n**Note:** Unlike `pull`, this method returns a new array.\n\n\n\n\n**Arguments:**\n\n@param array $array The array to inspect.\n\n@param array\u003cint, mixed\u003e $values The values to exclude.\n\n\n\n**Return:**\n\n@return array the new array of filtered values.\n\nExample:\n```php\n\u003c?php\n use function _\\without;\n\nwithout([2, 1, 2, 3], 1, 2)\n// =\u003e [3]\n\n```\n### zip\n\nCreates an array of grouped elements, the first of which contains the\nfirst elements of the given arrays, the second of which contains the\nsecond elements of the given arrays, and so on.\n\n\n\n\n**Arguments:**\n\n@param array ...$arrays The arrays to process.\n\n\n\n**Return:**\n\n@return array the new array of grouped elements.\n\nExample:\n```php\n\u003c?php\n use function _\\zip;\n\nzip(['a', 'b'], [1, 2], [true, false])\n// =\u003e [['a', 1, true], ['b', 2, false]]\n\n```\n### zipObject\n\nThis method is like `fromPairs` except that it accepts two arrays,\none of property identifiers and one of corresponding values.\n\n\n\n\n\n**Arguments:**\n\n@param array $props The property identifiers.\n\n@param array $values The property values.\n\n\n\n**Return:**\n\n@return object the new object.\n\nExample:\n```php\n\u003c?php\n use function _\\zipObject;\n\nzipObject(['a', 'b'], [1, 2])\n/* =\u003e object(stdClass)#210 (2) {\n[\"a\"] =\u003e int(1)\n[\"b\"] =\u003e int(2)\n}\n*\\/\n\n```\n### zipObjectDeep\n\nThis method is like `zipObject` except that it supports property paths.\n\n\n\n\n\n**Arguments:**\n\n@param array $props The property identifiers.\n\n@param array $values The property values.\n\n\n\n**Return:**\n\n@return \\stdClass the new object.\n\nExample:\n```php\n\u003c?php\n use function _\\zipObjectDeep;\n\nzipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2])\n/* =\u003e class stdClass#20 (1) {\npublic $a =\u003e class stdClass#19 (1) {\npublic $b =\u003e\narray(2) {\n[0] =\u003e class stdClass#17 (1) {\npublic $c =\u003e int(1)\n}\n[1] =\u003e class stdClass#18 (1) {\npublic $d =\u003e int(2)\n}\n}\n}\n}\n*\\/\n\n```\n### zipWith\n\nThis method is like `zip` except that it accepts `iteratee` to specify\nhow grouped values should be combined. The iteratee is invoked with the\nelements of each group: (...group).\n\n\n\n\n\n**Arguments:**\n\n@param array\u003cint, (array | callable)\u003e ...$arrays The arrays to process.\n\n@param callable $iteratee The function to combine grouped values.\n\n\n\n**Return:**\n\n@return array the new array of grouped elements.\n\nExample:\n```php\n\u003c?php\n use function _\\zipWith;\n\nzipWith([1, 2], [10, 20], [100, 200], function($a, $b, $c) { return $a + $b + $c; })\n// =\u003e [111, 222]\n\n```\n## Collection\n\n### countBy\n\nCreates an array composed of keys generated from the results of running\neach element of `collection` through `iteratee`. The corresponding value of\neach key is the number of times the key was returned by `iteratee`. The\niteratee is invoked with one argument: (value).\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $iteratee The iteratee to transform keys.\n\n\n\n**Return:**\n\n@return array Returns the composed aggregate object.\n\nExample:\n```php\n\u003c?php\n use function _\\countBy;\n\ncountBy([6.1, 4.2, 6.3], 'floor');\n// =\u003e ['6' =\u003e 2, '4' =\u003e 1]\n\n// The `property` iteratee shorthand.\ncountBy(['one', 'two', 'three'], 'strlen');\n// =\u003e ['3' =\u003e 2, '5' =\u003e 1]\n\n```\n### each\n\nIterates over elements of `collection` and invokes `iteratee` for each element.\nThe iteratee is invoked with three arguments: (value, index|key, collection).\nIteratee functions may exit iteration early by explicitly returning `false`.\n\n**Note:** As with other \"Collections\" methods, objects with a \"length\"\nproperty are iterated like arrays. To avoid this behavior use `forIn`\nor `forOwn` for object iteration.\n\n\n\n\n\n**Arguments:**\n\n@param (array | iterable | object) $collection The collection to iterate over.\n\n@param callable $iteratee The function invoked per iteration.\n\n\n\n**Return:**\n\n@return (array | object) Returns `collection`.\n\nExample:\n```php\n\u003c?php\n use function _\\each;\n\neach([1, 2], function ($value) { echo $value; })\n// =\u003e Echoes `1` then `2`.\n\neach((object) ['a' =\u003e 1, 'b' =\u003e 2], function ($value, $key) { echo $key; });\n// =\u003e Echoes 'a' then 'b' (iteration order is not guaranteed).\n\n```\n### eachRight\n\nThis method is like `each` except that it iterates over elements of\n`collection` from right to left.\n\n\n\n\n**Arguments:**\n\n@param (array | iterable | object) $collection The collection to iterate over.\n\n@param callable $iteratee The function invoked per iteration.\n\n\n\n**Return:**\n\n@return (array | object) Returns `collection`.\n\nExample:\n```php\n\u003c?php\n use function _\\eachRight;\n\neachRight([1, 2], function($value) { echo $value; })\n// =\u003e Echoes `2` then `1`.\n\n```\n### filter\n\nIterates over elements of `array`, returning an array of all elements\n`predicate` returns truthy for. The predicate is invoked with three\narguments: (value, index, array).\n\n**Note:** Unlike `remove`, this method returns a new array.\n\n\n\n\n\n**Arguments:**\n\n@param iterable $array The array to iterate over.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the new filtered array.\n\nExample:\n```php\n\u003c?php\n use function _\\filter;\n\n$users = [\n[ 'user' =\u003e 'barney', 'age' =\u003e 36, 'active' =\u003e true],\n[ 'user' =\u003e 'fred',   'age' =\u003e 40, 'active' =\u003e false]\n];\n\nfilter($users, function($o) { return !$o['active']; });\n// =\u003e objects for ['fred']\n\n// The `matches` iteratee shorthand.\nfilter($users, ['age' =\u003e 36, 'active' =\u003e true]);\n// =\u003e objects for ['barney']\n\n// The `matchesProperty` iteratee shorthand.\nfilter($users, ['active', false]);\n// =\u003e objects for ['fred']\n\n// The `property` iteratee shorthand.\nfilter($users, 'active');\n// =\u003e objects for ['barney']\n\n```\n### find\n\nIterates over elements of `collection`, returning the first element\n`predicate` returns truthy for. The predicate is invoked with three\narguments: (value, index|key, collection).\n\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to inspect.\n\n@param callable $predicate The function invoked per iteration.\n\n@param int $fromIndex The index to search from.\n\n\n\n**Return:**\n\n@return mixed Returns the matched element, else `null`.\n\nExample:\n```php\n\u003c?php\n use function _\\find;\n\n$users = [\n['user' =\u003e 'barney',  'age' =\u003e 36, 'active' =\u003e true],\n['user' =\u003e 'fred',    'age' =\u003e 40, 'active' =\u003e false],\n['user' =\u003e 'pebbles', 'age' =\u003e 1,  'active' =\u003e true]\n];\n\nfind($users, function($o) { return $o['age'] \u003c 40; });\n// =\u003e object for 'barney'\n\n// The `matches` iteratee shorthand.\nfind($users, ['age' =\u003e 1, 'active' =\u003e true]);\n// =\u003e object for 'pebbles'\n\n// The `matchesProperty` iteratee shorthand.\nfind($users, ['active', false]);\n// =\u003e object for 'fred'\n\n// The `property` iteratee shorthand.\nfind($users, 'active');\n// =\u003e object for 'barney'\n\n```\n### findLast\n\nThis method is like `find` except that it iterates over elements of\n`collection` from right to left.\n\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to inspect.\n\n@param callable $predicate The function invoked per iteration.\n\n@param int $fromIndex The index to search from.\n\n\n\n**Return:**\n\n@return mixed Returns the matched element, else `undefined`.\n\nExample:\n```php\n\u003c?php\n use function _\\findLast;\n\nfindLast([1, 2, 3, 4], function ($n) { return $n % 2 == 1; })\n// =\u003e 3\n\n```\n### flatMap\n\nCreates a flattened array of values by running each element in `collection`\nthrough `iteratee` and flattening the mapped results. The iteratee is invoked\nwith three arguments: (value, index|key, collection).\n\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $iteratee The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the new flattened array.\n\nExample:\n```php\n\u003c?php\n use function _\\flatMap;\n\nfunction duplicate($n) {\nreturn [$n, $n]\n}\n\nflatMap([1, 2], 'duplicate')\n// =\u003e [1, 1, 2, 2]\n\n```\n### flatMapDeep\n\nThis method is like `flatMap` except that it recursively flattens the\nmapped results.\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $iteratee The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array Returns the new flattened array.\n\nExample:\n```php\n\u003c?php\n use function _\\flatMapDeep;\n\nfunction duplicate($n) {\nreturn [[[$n, $n]]];\n}\n\nflatMapDeep([1, 2], 'duplicate');\n// =\u003e [1, 1, 2, 2]\n\n```\n### flatMapDepth\n\nThis method is like `flatMap` except that it recursively flattens the\nmapped results up to `depth` times.\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $iteratee The function invoked per iteration.\n\n@param int $depth The maximum recursion depth.\n\n\n\n**Return:**\n\n@return array the new flattened array.\n\nExample:\n```php\n\u003c?php\n use function _\\flatMapDepth;\n\nfunction duplicate($n) {\nreturn [[[$n, $n]]]\n}\n\nflatMapDepth([1, 2], 'duplicate', 2)\n// =\u003e [[1, 1], [2, 2]]\n\n```\n### groupBy\n\nCreates an array composed of keys generated from the results of running\neach element of `collection` through `iteratee`. The order of grouped values\nis determined by the order they occur in `collection`. The corresponding\nvalue of each key is an array of elements responsible for generating the\nkey. The iteratee is invoked with one argument: (value).\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $iteratee The iteratee to transform keys.\n\n\n\n**Return:**\n\n@return array Returns the composed aggregate object.\n\nExample:\n```php\n\u003c?php\n use function _\\groupBy;\n\ngroupBy([6.1, 4.2, 6.3], 'floor');\n// =\u003e ['6' =\u003e [6.1, 6.3], '4' =\u003e [4.2]]\n\ngroupBy(['one', 'two', 'three'], 'strlen');\n// =\u003e ['3' =\u003e ['one', 'two'], '5' =\u003e ['three']]\n\n```\n### invokeMap\n\nInvokes the method at `path` of each element in `collection`, returning\nan array of the results of each invoked method. Any additional arguments\nare provided to each invoked method. If `path` is a function, it's invoked\nfor, and `this` bound to, each element in `collection`.\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param (array | callable | string) $path The path of the method to invoke or the function invoked per iteration.\n\n@param array $args The arguments to invoke each method with.\n\n\n\n**Return:**\n\n@return array the array of results.\n\nExample:\n```php\n\u003c?php\n use function _\\invokeMap;\n\ninvokeMap([[5, 1, 7], [3, 2, 1]], function($result) { sort($result); return $result;})\n// =\u003e [[1, 5, 7], [1, 2, 3]]\n\ninvokeMap([123, 456], 'str_split')\n// =\u003e [['1', '2', '3'], ['4', '5', '6']]\n\n```\n### keyBy\n\nCreates an object composed of keys generated from the results of running\neach element of `collection` through `iteratee`. The corresponding value of\neach key is the last element responsible for generating the key. The\niteratee is invoked with one argument: (value).\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $iteratee The iteratee to transform keys.\n\n\n\n**Return:**\n\n@return array the composed aggregate object.\n\nExample:\n```php\n\u003c?php\n use function _\\keyBy;\n\n$array = [\n['direction' =\u003e 'left', 'code' =\u003e 97],\n['direction' =\u003e 'right', 'code' =\u003e 100],\n];\n\nkeyBy($array, function ($o) { return \\chr($o['code']); })\n// =\u003e ['a' =\u003e ['direction' =\u003e 'left', 'code' =\u003e 97], 'd' =\u003e ['direction' =\u003e 'right', 'code' =\u003e 100]]\n\nkeyBy($array, 'direction');\n// =\u003e ['left' =\u003e ['direction' =\u003e 'left', 'code' =\u003e 97], 'right' =\u003e ['direction' =\u003e 'right', 'code' =\u003e 100]]\n\n```\n### map\n\nCreates an array of values by running each element in `collection` through\n`iteratee`. The iteratee is invoked with three arguments:\n(value, index|key, collection).\n\nMany lodash-php methods are guarded to work as iteratees for methods like\n`_::every`, `_::filter`, `_::map`, `_::mapValues`, `_::reject`, and `_::some`.\n\nThe guarded methods are:\n`ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n`fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n`sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n`template`, `trim`, `trimEnd`, `trimStart`, and `words`\n\n\n\n\n**Arguments:**\n\n@param (array | object) $collection The collection to iterate over.\n\n@param (callable | string | array) $iteratee The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array Returns the new mapped array.\n\nExample:\n```php\n\u003c?php\n use function _\\map;\n\nfunction square(int $n) {\nreturn $n * $n;\n}\n\nmap([4, 8], $square);\n// =\u003e [16, 64]\n\nmap((object) ['a' =\u003e 4, 'b' =\u003e 8], $square);\n// =\u003e [16, 64] (iteration order is not guaranteed)\n\n$users = [\n[ 'user' =\u003e 'barney' ],\n[ 'user' =\u003e 'fred' ]\n];\n\n// The `property` iteratee shorthand.\nmap($users, 'user');\n// =\u003e ['barney', 'fred']\n\n```\n### orderBy\n\nThis method is like `sortBy` except that it allows specifying the sort\norders of the iteratees to sort by. If `orders` is unspecified, all values\nare sorted in ascending order. Otherwise, specify an order of \"desc\" for\ndescending or \"asc\" for ascending sort order of corresponding values.\n\n\n\n\n**Arguments:**\n\n@param (iterable | null) $collection The collection to iterate over.\n\n@param (array[] | callable[] | string[]) $iteratee The iteratee(s) to sort by.\n\n@param string[] $orders The sort orders of `iteratees`.\n\n\n\n**Return:**\n\n@return array the new sorted array.\n\nExample:\n```php\n\u003c?php\n use function _\\orderBy;\n\n$users = [\n['user' =\u003e 'fred',   'age' =\u003e 48],\n['user' =\u003e 'barney', 'age' =\u003e 34],\n['user' =\u003e 'fred',   'age' =\u003e 40],\n['user' =\u003e 'barney', 'age' =\u003e 36]\n]\n\n// Sort by `user` in ascending order and by `age` in descending order.\norderBy($users, ['user', 'age'], ['asc', 'desc'])\n// =\u003e [['user' =\u003e 'barney', 'age' =\u003e 36], ['user' =\u003e 'barney', 'age' =\u003e 34], ['user' =\u003e 'fred', 'age' =\u003e 48], ['user' =\u003e 'fred', 'age' =\u003e 40]]\n\n```\n### partition\n\nCreates an array of elements split into two groups, the first of which\ncontains elements `predicate` returns truthy for, the second of which\ncontains elements `predicate` returns falsey for. The predicate is\ninvoked with one argument: (value).\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the array of grouped elements.\n\nExample:\n```php\n\u003c?php\n use function _\\partition;\n\n$users = [\n['user' =\u003e 'barney',  'age' =\u003e 36, 'active' =\u003e false],\n['user' =\u003e 'fred',    'age' =\u003e 40, 'active' =\u003e true],\n['user' =\u003e 'pebbles', 'age' =\u003e 1,  'active' =\u003e false]\n];\n\npartition($users, function($user) { return $user['active']; })\n// =\u003e objects for [['fred'], ['barney', 'pebbles']]\n\n```\n### reduce\n\nReduces `collection` to a value which is the accumulated result of running\neach element in `collection` thru `iteratee`, where each successive\ninvocation is supplied the return value of the previous. If `accumulator`\nis not given, the first element of `collection` is used as the initial\nvalue. The iteratee is invoked with four arguments:\n(accumulator, value, index|key, collection).\n\nMany lodash methods are guarded to work as iteratees for methods like\n`reduce`, `reduceRight`, and `transform`.\n\nThe guarded methods are:\n`assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\nand `sortBy`\n\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param mixed $iteratee The function invoked per iteration.\n\n@param mixed $accumulator The initial value.\n\n\n\n**Return:**\n\n@return mixed Returns the accumulated value.\n\nExample:\n```php\n\u003c?php\n use function _\\reduce;\n\nreduce([1, 2], function($sum, $n) { return $sum + $n; }, 0)\n// =\u003e 3\n\nreduce(['a' =\u003e 1, 'b' =\u003e 2, 'c' =\u003e 1], function ($result, $value, $key) {\nif (!isset($result[$value])) {\n$result[$value] = [];\n}\n$result[$value][] = $key;\n\nreturn $result;\n}, [])\n// =\u003e ['1' =\u003e ['a', 'c'], '2' =\u003e ['b']] (iteration order is not guaranteed)\n\n```\n### reduceRight\n\nThis method is like `reduce` except that it iterates over elements of\n`collection` from right to left.\n\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param mixed $iteratee The function invoked per iteration.\n\n@param mixed $accumulator The initial value.\n\n\n\n**Return:**\n\n@return mixed Returns the accumulated value.\n\nExample:\n```php\n\u003c?php\n use function _\\reduceRight;\n\n$array = [[0, 1], [2, 3], [4, 5]];\n\nreduceRight(array, (flattened, other) =\u003e flattened.concat(other), [])\n// =\u003e [4, 5, 2, 3, 0, 1]\n\n```\n### reject\n\nThe opposite of `filter` this method returns the elements of `collection`\nthat `predicate` does **not** return truthy for.\n\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param callable $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return array the new filtered array.\n\nExample:\n```php\n\u003c?php\n use function _\\reject;\n\n$users = [\n['user' =\u003e 'barney', 'active' =\u003e true],\n['user' =\u003e 'fred',   'active' =\u003e false]\n]\n\nreject($users, 'active')\n// =\u003e objects for ['fred']\n\n```\n### size\n\nGets the size of `collection` by returning its length for array\nvalues or the number of public properties for objects.\n\n\n\n\n**Arguments:**\n\n@param (array | object | string) $collection The collection to inspect.\n\n\n\n**Return:**\n\n@return int Returns the collection size.\n\nExample:\n```php\n\u003c?php\n use function _\\size;\n\nsize([1, 2, 3]);\n// =\u003e 3\n\nsize(new class { public $a = 1; public $b = 2; private $c = 3; });\n// =\u003e 2\n\nsize('pebbles');\n// =\u003e 7\n\n```\n### some\n\nChecks if `predicate` returns truthy for **any** element of `collection`.\nIteration is stopped once `predicate` returns truthy. The predicate is\ninvoked with three arguments: (value, index|key, collection).\n\n\n\n\n**Arguments:**\n\n@param iterable $collection The collection to iterate over.\n\n@param (callable | string | array) $predicate The function invoked per iteration.\n\n\n\n**Return:**\n\n@return boolean Returns `true` if any element passes the predicate check, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\some;\n\nsome([null, 0, 'yes', false], , function ($value) { return \\is_bool($value); }));\n// =\u003e true\n\n$users = [\n['user' =\u003e 'barney', 'active' =\u003e true],\n['user' =\u003e 'fred',   'active' =\u003e false]\n];\n\n// The `matches` iteratee shorthand.\nsome($users, ['user' =\u003e 'barney', 'active' =\u003e false ]);\n// =\u003e false\n\n// The `matchesProperty` iteratee shorthand.\nsome($users, ['active', false]);\n// =\u003e true\n\n// The `property` iteratee shorthand.\nsome($users, 'active');\n// =\u003e true\n\n```\n### sortBy\n\nCreates an array of elements, sorted in ascending order by the results of\nrunning each element in a collection through each iteratee. This method\nperforms a stable sort, that is, it preserves the original sort order of\nequal elements. The iteratees are invoked with one argument: (value).\n\n\n\n\n**Arguments:**\n\n@param (array | object | null) $collection The collection to iterate over.\n\n@param (callable | callable[]) $iteratees The iteratees to sort by.\n\n\n\n**Return:**\n\n@return array Returns the new sorted array.\n\nExample:\n```php\n\u003c?php\n use function _\\sortBy;\n\n$users = [\n[ 'user' =\u003e 'fred',   'age' =\u003e 48 ],\n[ 'user' =\u003e 'barney', 'age' =\u003e 36 ],\n[ 'user' =\u003e 'fred',   'age' =\u003e 40 ],\n[ 'user' =\u003e 'barney', 'age' =\u003e 34 ],\n];\n\nsortBy($users, [function($o) { return $o['user']; }]);\n// =\u003e [['user' =\u003e 'barney', 'age' =\u003e 36], ['user' =\u003e 'barney', 'age' =\u003e 34], ['user' =\u003e 'fred', 'age' =\u003e 48], ['user' =\u003e 'fred', 'age' =\u003e 40]]\n\nsortBy($users, ['user', 'age']);\n// =\u003e [['user' =\u003e 'barney', 'age' =\u003e 34], ['user' =\u003e 'barney', 'age' =\u003e 36], ['user' =\u003e 'fred', 'age' =\u003e 40], ['user' =\u003e 'fred', 'age' =\u003e 48]]\n\n```\n## Date\n\n### now\n\nGets the timestamp of the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC).\n\n\n\n\n**Arguments:**\n\n\n\n**Return:**\n\n@return int Returns the timestamp.\n\nExample:\n```php\n\u003c?php\n use function _\\now;\n\nnow();\n// =\u003e 1511180325735\n\n```\n## Function\n\n### after\n\nThe opposite of `before`; this method creates a function that invokes\n`func` once it's called `n` or more times.\n\n\n\n\n\n**Arguments:**\n\n@param int $n The number of calls before `func` is invoked.\n\n@param Callable $func The function to restrict.\n\n\n\n**Return:**\n\n@return Callable Returns the new restricted function.\n\nExample:\n```php\n\u003c?php\n use function _\\after;\n\n$saves = ['profile', 'settings'];\n\n$done = after(count($saves), function() {\necho 'done saving!';\n});\n\nforEach($saves, function($type) use($done) {\nasyncSave([ 'type' =\u003e $type, 'complete' =\u003e $done ]);\n});\n// =\u003e Prints 'done saving!' after the two async saves have completed.\n\n```\n### ary\n\nCreates a function that invokes `func`, with up to `n` arguments,\nignoring any additional arguments.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to cap arguments for.\n\n@param int $n The arity cap.\n\n\n\n**Return:**\n\n@return Callable Returns the new capped function.\n\nExample:\n```php\n\u003c?php\n use function _\\ary;\n\nmap(['6', '8', '10'], ary('intval', 1));\n// =\u003e [6, 8, 10]\n\n```\n### before\n\nCreates a function that invokes `func`, with the arguments\nof the created function, while it's called less than `n` times. Subsequent\ncalls to the created function return the result of the last `func` invocation.\n\n\n\n\n\n**Arguments:**\n\n@param int $n The number of calls at which `func` is no longer invoked.\n\n@param callable $func The function to restrict.\n\n\n\n**Return:**\n\n@return callable Returns the new restricted function.\n\nExample:\n```php\n\u003c?php\n use function _\\before;\n\n$users = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n$result = uniqBy(map($users, before(5, [$repository, 'find'])), 'id')\n// =\u003e Fetch up to 4 results.\n\n```\n### bind\n\nCreates a function that invokes `func` with the `this` binding of `object`\nand `partials` prepended to the arguments it receives.\n\n\n\n\n**Arguments:**\n\n@param callable $function The function to bind.\n\n@param (object | mixed) $object The `object` binding of `func`.\n\n@param array\u003cint, mixed\u003e $partials The arguments to be partially applied.\n\n\n\n**Return:**\n\n@return callable Returns the new bound function.\n\nExample:\n```php\n\u003c?php\n use function _\\bind;\n\nfunction greet($greeting, $punctuation) {\nreturn $greeting . ' ' . $this-\u003euser . $punctuation;\n}\n\n$object = $object = new class {\npublic $user = 'fred';\n};\n\n$bound = bind('greet', $object, 'hi');\n$bound('!');\n// =\u003e 'hi fred!'\n\n```\n### bindKey\n\nCreates a function that invokes the method `$function` of `$object` with `$partials`\nprepended to the arguments it receives.\n\nThis method differs from `bind` by allowing bound functions to reference\nmethods that may be redefined or don't yet exist\n\n\n\n\n**Arguments:**\n\n@param object $object The object to invoke the method on.\n\n@param string $function The name of the method.\n\n@param array\u003cint, mixed\u003e $partials The arguments to be partially applied.\n\n\n\n**Return:**\n\n@return callable Returns the new bound function.\n\nExample:\n```php\n\u003c?php\n use function _\\bindKey;\n\n$object = new class {\nprivate $user = 'fred';\nfunction greet($greeting, $punctuation) {\nreturn $greeting.' '.$this-\u003euser.$punctuation;\n}\n};\n\n$bound = bindKey($object, 'greet', 'hi');\n$bound('!');\n// =\u003e 'hi fred!'\n\n```\n### curry\n\nCreates a function that accepts arguments of `func` and either invokes\n`func` returning its result, if at least `arity` number of arguments have\nbeen provided, or returns a function that accepts the remaining `func`\narguments, and so on. The arity of `func` may be specified if `func.length`\nis not sufficient.\n\nThe `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\nmay be used as a placeholder for provided arguments.\n\n**Note:** This method doesn't set the \"length\" property of curried functions.\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to curry.\n\n@param (int | null) $arity The arity of `func`.\n\n\n\n**Return:**\n\n@return callable Returns the new curried function.\n\nExample:\n```php\n\u003c?php\n use function _\\curry;\n\n$abc = function($a, $b, $c) {\nreturn [$a, $b, $c];\n};\n\n$curried = curry($abc);\n\n$curried(1)(2)(3);\n// =\u003e [1, 2, 3]\n\n$curried(1, 2)(3);\n// =\u003e [1, 2, 3]\n\n$curried(1, 2, 3);\n// =\u003e [1, 2, 3]\n\n// Curried with placeholders.\n$curried(1)(_, 3)(2);\n// =\u003e [1, 2, 3]\n\n```\n### delay\n\nInvokes `func` after `wait` milliseconds. Any additional arguments are\nprovided to `func` when it's invoked.\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to delay.\n\n@param int $wait The number of milliseconds to delay invocation.\n\n@param array\u003cint, mixed\u003e $args\n\n\n\n**Return:**\n\n@return int the timer id.\n\nExample:\n```php\n\u003c?php\n use function _\\delay;\n\ndelay(function($text) {\necho $text;\n}, 1000, 'later');\n// =\u003e Echo 'later' after one second.\n\n```\n### flip\n\nCreates a function that invokes `func` with arguments reversed.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to flip arguments for.\n\n\n\n**Return:**\n\n@return callable Returns the new flipped function.\n\nExample:\n```php\n\u003c?php\n use function _\\flip;\n\n$flipped = flip(function() {\nreturn func_get_args();\n});\n\nflipped('a', 'b', 'c', 'd');\n// =\u003e ['d', 'c', 'b', 'a']\n\n```\n### memoize\n\nCreates a function that memoizes the result of `func`. If `resolver` is\nprovided, it determines the cache key for storing the result based on the\narguments provided to the memoized function. By default, the first argument\nprovided to the memoized function is used as the map cache key\n\n**Note:** The cache is exposed as the `cache` property on the memoized\nfunction. Its creation may be customized by replacing the `_.memoize.Cache`\nconstructor with one whose instances implement the\n[`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\nmethod interface of `clear`, `delete`, `get`, `has`, and `set`.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to have its output memoized.\n\n@param (callable | null) $resolver The function to resolve the cache key.\n\n\n\n**Return:**\n\n@return callable Returns the new memoized function.\n\nExample:\n```php\n\u003c?php\n use function _\\memoize;\n\n$object = ['a' =\u003e 1, 'b' =\u003e 2];\n$other = ['c' =\u003e 3, 'd' =\u003e 4];\n\n$values = memoize('_\\values');\n$values($object);\n// =\u003e [1, 2]\n\n$values($other);\n// =\u003e [3, 4]\n\n$object['a'] = 2;\n$values($object);\n// =\u003e [1, 2]\n\n// Modify the result cache.\n$values-\u003ecache-\u003eset($object, ['a', 'b']);\n$values($object);\n// =\u003e ['a', 'b']\n\n```\n### negate\n\nCreates a function that negates the result of the predicate `func`\n\n\n\n\n\n**Arguments:**\n\n@param callable $predicate The predicate to negate.\n\n\n\n**Return:**\n\n@return callable Returns the new negated function.\n\nExample:\n```php\n\u003c?php\n use function _\\negate;\n\nfunction isEven($n) {\nreturn $n % 2 == 0;\n}\n\nfilter([1, 2, 3, 4, 5, 6], negate($isEven));\n// =\u003e [1, 3, 5]\n\n```\n### once\n\nCreates a function that is restricted to invoking `func` once. Repeat calls\nto the function return the value of the first invocation. The `func` is\ninvoked with the arguments of the created function.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to restrict.\n\n\n\n**Return:**\n\n@return callable the new restricted function.\n\nExample:\n```php\n\u003c?php\n use function _\\once;\n\n$initialize = once('createApplication');\n$initialize();\n$initialize();\n// =\u003e `createApplication` is invoked once\n\n```\n### overArgs\n\nCreates a function that invokes `func` with its arguments transformed.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to wrap.\n\n@param callable[] $transforms The argument transforms.\n\n\n\n**Return:**\n\n@return callable the new function.\n\nExample:\n```php\n\u003c?php\n use function _\\overArgs;\n\nfunction doubled($n) {\nreturn $n * 2;\n}\n\nfunction square($n) {\nreturn $n * $n;\n}\n\n$func = overArgs(function($x, $y) {\nreturn [$x, $y];\n}, ['square', 'doubled']);\n\n$func(9, 3);\n// =\u003e [81, 6]\n\n$func(10, 5);\n// =\u003e [100, 10]\n\n```\n### partial\n\nCreates a function that invokes `func` with `partials` prepended to the\narguments it receives.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to partially apply arguments to.\n\n@param array\u003cint, mixed\u003e $partials The arguments to be partially applied.\n\n\n\n**Return:**\n\n@return callable Returns the new partially applied function.\n\nExample:\n```php\n\u003c?php\n use function _\\partial;\n\nfunction greet($greeting, $name) {\nreturn $greeting . ' ' . $name;\n}\n\n$sayHelloTo = partial('greet', 'hello');\n$sayHelloTo('fred');\n// =\u003e 'hello fred'\n\n```\n### rest\n\nCreates a function that invokes `func` with the `this` binding of the\ncreated function and arguments from `start` and beyond provided as\nan array.\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to apply a rest parameter to.\n\n@param (int | null) $start The start position of the rest parameter.\n\n\n\n**Return:**\n\n@return callable Returns the new function.\n\nExample:\n```php\n\u003c?php\n use function _\\rest;\n\n$say = rest(function($what, $names) {\nreturn $what . ' ' . implode(', ', initial($names)) .\n(size($names) \u003e 1 ? ', \u0026 ' : '') . last($names);\n});\n\n$say('hello', 'fred', 'barney', 'pebbles');\n// =\u003e 'hello fred, barney, \u0026 pebbles'\n\n```\n### spread\n\nCreates a function that invokes `func` with the `this` binding of the\ncreate function and an array of arguments much like\n[`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n\n**Note:** This method is based on the\n[spread operator](https://mdn.io/spread_operator).\n\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to spread arguments over.\n\n@param int $start The start position of the spread.\n\n\n\n**Return:**\n\n@return callable Returns the new function.\n\nExample:\n```php\n\u003c?php\n use function _\\spread;\n\n$say = spread(function($who, $what) {\nreturn $who . ' says ' . $what;\n});\n\n$say(['fred', 'hello']);\n// =\u003e 'fred says hello'\n\n```\n### unary\n\nCreates a function that accepts up to one argument, ignoring any\nadditional arguments.\n\n\n\n\n**Arguments:**\n\n@param callable $func The function to cap arguments for.\n\n\n\n**Return:**\n\n@return callable the new capped function.\n\nExample:\n```php\n\u003c?php\n use function _\\unary;\n\nmap(['6', '8', '10'], unary('intval'));\n// =\u003e [6, 8, 10]\n\n```\n### wrap\n\nCreates a function that provides `value` to `wrapper` as its first\nargument. Any additional arguments provided to the function are appended\nto those provided to the `wrapper`.\n\n\n\n\n**Arguments:**\n\n@param mixed $value The value to wrap.\n\n@param callable $wrapper The wrapper function.\n\n\n\n**Return:**\n\n@return callable the new function.\n\nExample:\n```php\n\u003c?php\n use function _\\wrap;\n\n$p = wrap('_\\escape', function($func, $text) {\nreturn '\u003cp\u003e' . $func($text) . '\u003c/p\u003e';\n});\n\n$p('fred, barney, \u0026 pebbles');\n// =\u003e '\u003cp\u003efred, barney, \u0026amp; pebbles\u003c/p\u003e'\n\n```\n## Lang\n\n### eq\n\nPerforms a comparison between two values to determine if they are equivalent.\n\n\n\n\n**Arguments:**\n\n@param mixed $value The value to compare.\n\n@param mixed $other The other value to compare.\n\n\n\n**Return:**\n\n@return boolean Returns `true` if the values are equivalent, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\eq;\n\n$object = (object) ['a' =\u003e 1];\n$other = (object) ['a' =\u003e 1];\n\neq($object, $object);\n// =\u003e true\n\neq($object, $other);\n// =\u003e false\n\neq('a', 'a');\n// =\u003e true\n\neq(['a'], (object) ['a']);\n// =\u003e false\n\neq(INF, INF);\n// =\u003e true\n\n```\n### isEqual\n\nPerforms a deep comparison between two values to determine if they are\nequivalent.\n\n**Note:** This method supports comparing arrays, booleans,\nDateTime objects, exception objects, SPLObjectStorage, numbers,\nstrings, typed arrays, resources, DOM Nodes. objects are compared\nby their own, not inherited, enumerable properties.\n\n\n\n\n\n**Arguments:**\n\n@param mixed $value The value to compare.\n\n@param mixed $other The other value to compare.\n\n\n\n**Return:**\n\n@return bool Returns `true` if the values are equivalent, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\isEqual;\n\n\n$object = [ 'a' =\u003e 1]\n$other = ['a' =\u003e '1']\n\nisEqual($object, $other)\n// =\u003e true\n\n$object === $other\n// =\u003e false\n\n```\n### isError\n\nChecks if `value` is an `\\Exception`, `\\ParseError`, \\Error`, \\Throwable`, \\SoapFault`, \\DOMException`, \\PDOException`, object.\n\n\n\n\n\n**Arguments:**\n\n@param mixed $value The value to check.\n\n\n\n**Return:**\n\n@return boolean Returns `true` if `value` is an error object, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\isError;\n\nisError(new \\Exception())\n// =\u003e true\n\nisError(\\Exception::Class)\n// =\u003e false\n\n```\n## Math\n\n### add\n\nAdds two numbers.\n\n\n\n\n\n**Arguments:**\n\n@param (int | float | string) $augend The first number in an addition.\n\n@param (int | float | string) $addend The second number in an addition.\n\n\n\n**Return:**\n\n@return (int | float) Returns the total.\n\nExample:\n```php\n\u003c?php\n use function _\\add;\n\nadd(6, 4);\n// =\u003e 10\n\n```\n### max\n\nComputes the maximum value of `array`. If `array` is empty or falsey, null is returned.\n\n\n\n\n**Arguments:**\n\n@param (array | null) $array The array to iterate over.\n\n\n\n**Return:**\n\n@return (int | null) Returns the maximum value.\n\nExample:\n```php\n\u003c?php\n use function _\\max;\n\nmax([4, 2, 8, 6]);\n// =\u003e 8\n\nmax([]);\n// =\u003e null\n\n```\n### maxBy\n\nThis method is like `max` except that it accepts `iteratee` which is\ninvoked for each element in `array` to generate the criterion by which\nthe value is ranked. The iteratee is invoked with one argument: (value).\n\n\n\n\n**Arguments:**\n\n@param array $array The array to iterate over.\n\n@param (callable | string) $iteratee The iteratee invoked per element.\n\n\n\n**Return:**\n\n@return mixed Returns the maximum value.\n\nExample:\n```php\n\u003c?php\n use function _\\maxBy;\n\n$objects = [['n' =\u003e 1], ['n' =\u003e 2]];\n\nmaxBy($objects, function($o) { return $o['n']; });\n// =\u003e ['n' =\u003e 2]\n\n// The `property` iteratee shorthand.\nmaxBy($objects, 'n');\n// =\u003e ['n' =\u003e 2]\n\n```\n## Number\n\n### clamp\n\nClamps `number` within the inclusive `lower` and `upper` bounds.\n\n\n\n\n\n**Arguments:**\n\n@param int $number The number to clamp.\n\n@param int $lower The lower bound.\n\n@param int $upper The upper bound.\n\n\n\n**Return:**\n\n@return int Returns the clamped number.\n\nExample:\n```php\n\u003c?php\n use function _\\clamp;\n\nclamp(-10, -5, 5)\n// =\u003e -5\n\nclamp(10, -5, 5)\n// =\u003e 5\n\n```\n### inRange\n\nChecks if `number` is between `start` and up to, but not including, `end`. If\n`end` is not specified, it's set to `start` with `start` then set to `0`.\nIf `start` is greater than `end` the params are swapped to support\nnegative ranges.\n\n\n\n\n\n**Arguments:**\n\n@param float $number The number to check.\n\n@param float $start The start of the range.\n\n@param float $end The end of the range.\n\n\n\n**Return:**\n\n@return boolean Returns `true` if `number` is in the range, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\inRange;\n\ninRange(3, 2, 4)\n// =\u003e true\n\ninRange(4, 8)\n// =\u003e true\n\ninRange(4, 2)\n// =\u003e false\n\ninRange(2, 2)\n// =\u003e false\n\ninRange(1.2, 2)\n// =\u003e true\n\ninRange(5.2, 4)\n// =\u003e false\n\ninRange(-3, -2, -6)\n// =\u003e true\n\n```\n### random\n\nProduces a random number between the inclusive `lower` and `upper` bounds.\nIf only one argument is provided a number between `0` and the given number\nis returned. If `floating` is `true`, or either `lower` or `upper` are\nfloats, a floating-point number is returned instead of an integer.\n\n\n\n\n\n**Arguments:**\n\n@param (int | float | bool) $lower The lower bound.\n\n@param (int | float | bool) $upper The upper bound.\n\n@param (bool | null) $floating Specify returning a floating-point number.\n\n\n\n**Return:**\n\n@return (int | float) Returns the random number.\n\nExample:\n```php\n\u003c?php\n use function _\\random;\n\nrandom(0, 5)\n// =\u003e an integer between 0 and 5\n\nrandom(5)\n// =\u003e also an integer between 0 and 5\n\nrandom(5, true)\n// =\u003e a floating-point number between 0 and 5\n\nrandom(1.2, 5.2)\n// =\u003e a floating-point number between 1.2 and 5.2\n\n```\n## Object\n\n### get\n\nGets the value at path of object. If the resolved value is null the defaultValue is returned in its place.\n\n\n\n\n\n\n**Arguments:**\n\n@param mixed $object The associative array or object to fetch value from\n\n@param (array | string) $path Dot separated or array of string\n\n@param mixed $defaultValue (optional)The value returned for unresolved or null values.\n\n\n\n**Return:**\n\n@return mixed Returns the resolved value.\n\nExample:\n```php\n\u003c?php\n use function _\\get;\n\n$sampleArray = [\"key1\" =\u003e [\"key2\" =\u003e [\"key3\" =\u003e \"val1\", \"key4\" =\u003e \"\"]]];\nget($sampleArray, 'key1.key2.key3');\n// =\u003e \"val1\"\n\nget($sampleArray, 'key1.key2.key5', \"default\");\n// =\u003e \"default\"\n\nget($sampleArray, 'key1.key2.key4', \"default\");\n// =\u003e \"\"\n\n```\n### pick\n\nCreates an object composed of the picked `object` properties.\n\n\n\n\n**Arguments:**\n\n@param object $object The source object.\n\n@param (string | string[]) $paths The property paths to pick.\n\n\n\n**Return:**\n\n@return \\stdClass Returns the new object.\n\nExample:\n```php\n\u003c?php\n use function _\\pick;\n\n$object = (object) ['a' =\u003e 1, 'b' =\u003e '2', 'c' =\u003e 3];\n\npick($object, ['a', 'c']);\n// =\u003e (object) ['a' =\u003e 1, 'c' =\u003e 3]\n\n```\n### pickBy\n\nCreates an object composed of the `object` properties `predicate` returns\ntruthy for. The predicate is invoked with two arguments: (value, key).\n\n\n\n\n**Arguments:**\n\n@param (object | null) $object The source object.\n\n@param callable $predicate The function invoked per property.\n\n\n\n**Return:**\n\n@return \\stdClass Returns the new object.\n\nExample:\n```php\n\u003c?php\n use function _\\pickBy;\n\n$object = (object) ['a' =\u003e 1, 'b' =\u003e 'abc', 'c' =\u003e 3];\n\npickBy(object, 'is_numeric');\n// =\u003e (object) ['a' =\u003e 1, 'c' =\u003e 3]\n\n```\n## Seq\n\n### chain\n\nCreates a `lodash` wrapper instance that wraps `value` with explicit method\nchain sequences enabled. The result of such sequences must be unwrapped\nwith `-\u003evalue()`.\n\n\n\n\n**Arguments:**\n\n@param mixed $value The value to wrap.\n\n\n\n**Return:**\n\n@return \\_ Returns the new `lodash` wrapper instance.\n\nExample:\n```php\n\u003c?php\n use function _\\chain;\n\n$users = [\n['user' =\u003e 'barney',  'age' =\u003e 36],\n['user' =\u003e 'fred',    'age' =\u003e 40],\n['user' =\u003e 'pebbles', 'age' =\u003e 1 ],\n];\n\n$youngest = chain($users)\n-\u003esortBy('age')\n-\u003emap(function($o) {\nreturn $o['user'] . ' is ' . $o['age'];\n})\n-\u003ehead()\n-\u003evalue();\n// =\u003e 'pebbles is 1'\n\n```\n## String\n\n### camelCase\n\nConverts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the camel cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\camelCase;\n\ncamelCase('Foo Bar')\n// =\u003e 'fooBar'\n\ncamelCase('--foo-bar--')\n// =\u003e 'fooBar'\n\ncamelCase('__FOO_BAR__')\n// =\u003e 'fooBar'\n\n```\n### capitalize\n\nConverts the first character of `string` to upper case and the remaining\nto lower case.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to capitalize.\n\n\n\n**Return:**\n\n@return string Returns the capitalized string.\n\nExample:\n```php\n\u003c?php\n use function _\\capitalize;\n\ncapitalize('FRED')\n// =\u003e 'Fred'\n\n```\n### deburr\n\nDeburrs `string` by converting\n[Latin-1 Supplement](https =\u003e//en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\nand [Latin Extended-A](https =\u003e//en.wikipedia.org/wiki/Latin_Extended-A)\nletters to basic Latin letters and removing\n[combining diacritical marks](https =\u003e//en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to deburr.\n\n\n\n**Return:**\n\n@return string Returns the deburred string.\n\nExample:\n```php\n\u003c?php\n use function _\\deburr;\n\ndeburr('déjà vu')\n// =\u003e 'deja vu'\n\n```\n### endsWith\n\nChecks if `string` ends with the given target string.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to inspect.\n\n@param string $target The string to search for.\n\n@param int $position The position to search up to.\n\n\n\n**Return:**\n\n@return boolean Returns `true` if `string` ends with `target`, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\endsWith;\n\nendsWith('abc', 'c')\n// =\u003e true\n\nendsWith('abc', 'b')\n// =\u003e false\n\nendsWith('abc', 'b', 2)\n// =\u003e true\n\n```\n### escape\n\nConverts the characters \"\u0026\", \"\u003c\", \"\u003e\", '\"', and \"'\" in `string` to their\ncorresponding HTML entities.\n\n\nThough the \"\u003e\" character is escaped for symmetry, characters like\n\"\u003e\" and \"/\" don't need escaping in HTML and have no special meaning\nunless they're part of a tag or unquoted attribute value. See\n[Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n(under \"semi-related fun fact\") for more details.\n\nWhen working with HTML you should always\n[quote attribute values](http://wonko.com/post/html-escaping) to reduce\nXSS vectors.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to escape.\n\n\n\n**Return:**\n\n@return string Returns the escaped string.\n\nExample:\n```php\n\u003c?php\n use function _\\escape;\n\nescape('fred, barney, \u0026 pebbles')\n// =\u003e 'fred, barney, \u0026amp pebbles'\n\n```\n### escapeRegExp\n\nEscapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n\"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to escape.\n\n\n\n**Return:**\n\n@return string Returns the escaped string.\n\nExample:\n```php\n\u003c?php\n use function _\\escapeRegExp;\n\nescapeRegExp('[lodash](https://lodash.com/)')\n// =\u003e '\\[lodash\\]\\(https://lodash\\.com/\\)'\n\n```\n### kebabCase\n\nConverts `string` to\n[kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the kebab cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\kebabCase;\n\nkebabCase('Foo Bar')\n// =\u003e 'foo-bar'\n\nkebabCase('fooBar')\n// =\u003e 'foo-bar'\n\nkebabCase('__FOO_BAR__')\n// =\u003e 'foo-bar'\n\n```\n### lowerCase\n\nConverts `string`, as space separated words, to lower case.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the lower cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\lowerCase;\n\nlowerCase('--Foo-Bar--')\n// =\u003e 'foo bar'\n\nlowerCase('fooBar')\n// =\u003e 'foo bar'\n\nlowerCase('__FOO_BAR__')\n// =\u003e 'foo bar'\n\n```\n### lowerFirst\n\nConverts the first character of `string` to lower case.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the converted string.\n\nExample:\n```php\n\u003c?php\n use function _\\lowerFirst;\n\nlowerFirst('Fred')\n// =\u003e 'fred'\n\nlowerFirst('FRED')\n// =\u003e 'fRED'\n\n```\n### pad\n\nPads `string` on the left and right sides if it's shorter than `length`.\nPadding characters are truncated if they can't be evenly divided by `length`.\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to pad.\n\n@param int $length The padding length.\n\n@param string $chars The string used as padding.\n\n\n\n**Return:**\n\n@return string Returns the padded string.\n\nExample:\n```php\n\u003c?php\n use function _\\pad;\n\npad('abc', 8)\n// =\u003e '  abc   '\n\npad('abc', 8, '_-')\n// =\u003e '_-abc_-_'\n\npad('abc', 2)\n// =\u003e 'abc'\n\n```\n### padEnd\n\nPads `string` on the right side if it's shorter than `length`. Padding\ncharacters are truncated if they exceed `length`.\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to pad.\n\n@param int $length The padding length.\n\n@param string $chars The string used as padding.\n\n\n\n**Return:**\n\n@return string Returns the padded string.\n\nExample:\n```php\n\u003c?php\n use function _\\padEnd;\n\npadEnd('abc', 6)\n// =\u003e 'abc   '\n\npadEnd('abc', 6, '_-')\n// =\u003e 'abc_-_'\n\npadEnd('abc', 2)\n// =\u003e 'abc'\n\n```\n### padStart\n\nPads `string` on the left side if it's shorter than `length`. Padding\ncharacters are truncated if they exceed `length`.\n\n\n\ns\n**Arguments:**\n\n@param string $string ='' The string to pad.\n\n@param int $length The padding length.\n\n@param string $chars The string used as padding.\n\n\n\n**Return:**\n\n@return string Returns the padded string.\n\nExample:\n```php\n\u003c?php\n use function _\\padStart;\n\npadStart('abc', 6)\n// =\u003e '   abc'\n\npadStart('abc', 6, '_-')\n// =\u003e '_-_abc'\n\npadStart('abc', 2)\n// =\u003e 'abc'\n\n```\n### parseInt\n\nConverts `string` to an integer of the specified radix. If `radix` is\n`undefined` or `0`, a `radix` of `10` is used unless `string` is a\nhexadecimal, in which case a `radix` of `16` is used.\n\n**Note:** This method uses PHP's built-in integer casting, which does not necessarily align with the\n[ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n\n\n\n\n\n**Arguments:**\n\n@param (int | float | string) $string The string to convert.\n\n@param int $radix The radix to interpret `string` by.\n\n\n\n**Return:**\n\n@return int Returns the converted integer.\n\nExample:\n```php\n\u003c?php\n use function _\\parseInt;\n\nparseInt('08')\n// =\u003e 8\n\n```\n### repeat\n\nRepeats the given string `n` times.\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to repeat.\n\n@param int $n The number of times to repeat the string.\n\n\n\n**Return:**\n\n@return string Returns the repeated string.\n\nExample:\n```php\n\u003c?php\n use function _\\repeat;\n\nrepeat('*', 3)\n// =\u003e '***'\n\nrepeat('abc', 2)\n// =\u003e 'abcabc'\n\nrepeat('abc', 0)\n// =\u003e ''\n\n```\n### replace\n\nReplaces matches for `pattern` in `string` with `replacement`.\n\n**Note:** This method is based on\n[`String#replace`](https://mdn.io/String/replace).\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to modify.\n\n@param string $pattern The pattern to replace.\n\n@param (callable | string) $replacement The match replacement.\n\n\n\n**Return:**\n\n@return string Returns the modified string.\n\nExample:\n```php\n\u003c?php\n use function _\\replace;\n\nreplace('Hi Fred', 'Fred', 'Barney')\n// =\u003e 'Hi Barney'\n\n```\n### snakeCase\n\nConverts `string` to\n[snake case](https://en.wikipedia.org/wiki/Snake_case).\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the snake cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\snakeCase;\n\nsnakeCase('Foo Bar')\n// =\u003e 'foo_bar'\n\nsnakeCase('fooBar')\n// =\u003e 'foo_bar'\n\nsnakeCase('--FOO-BAR--')\n// =\u003e 'foo_bar'\n\n```\n### split\n\nSplits `string` by `separator`.\n\n**Note:** This method is based on\n[`String#split`](https://mdn.io/String/split).\n\n\n\n\n**Arguments:**\n\n@param string $string The string to split.\n\n@param string $separator The separator pattern to split by.\n\n@param int $limit The length to truncate results to.\n\n\n\n**Return:**\n\n@return array Returns the string segments.\n\nExample:\n```php\n\u003c?php\n use function _\\split;\n\nsplit('a-b-c', '-', 2)\n// =\u003e ['a', 'b']\n\n```\n### startCase\n\nConverts `string` to\n[start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the start cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\startCase;\n\nstartCase('--foo-bar--')\n// =\u003e 'Foo Bar'\n\nstartCase('fooBar')\n// =\u003e 'Foo Bar'\n\nstartCase('__FOO_BAR__')\n// =\u003e 'FOO BAR'\n\n```\n### startsWith\n\nChecks if `string` starts with the given target string.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to inspect.\n\n@param string $target The string to search for.\n\n@param int $position The position to search from.\n\n\n\n**Return:**\n\n@return boolean Returns `true` if `string` starts with `target`, else `false`.\n\nExample:\n```php\n\u003c?php\n use function _\\startsWith;\n\nstartsWith('abc', 'a')\n// =\u003e true\n\nstartsWith('abc', 'b')\n// =\u003e false\n\nstartsWith('abc', 'b', 1)\n// =\u003e true\n\n```\n### template\n\nCreates a compiled template function that can interpolate data properties\nin \"interpolate\" delimiters, HTML-escape interpolated data properties in\n\"escape\" delimiters, and execute PHP in \"evaluate\" delimiters. Data\nproperties may be accessed as free variables in the template. If a setting\nobject is given, it takes precedence over `$templateSettings` values.\n\n\nRegExp $options['escape'] = _::$templateSettings['escape'] The HTML \"escape\" delimiter.\nRegExp $options['evaluate'] = _::$templateSettings['evaluate'] The \"evaluate\" delimiter.\narray  $options['imports'] = _::$templateSettings['imports'] An object to import into the template as free variables.\nRegExp $options['interpolate'] = _::$templateSettings['interpolate'] The \"interpolate\" delimiter.\n\n\n\n**Arguments:**\n\n@param string $string The template string.\n\n@param array $options The options array.\n\n\n\n**Return:**\n\n@return callable Returns the compiled template function.\n\nExample:\n```php\n\u003c?php\n use function _\\template;\n\n// Use the \"interpolate\" delimiter to create a compiled template.\n$compiled = template('hello \u003c%= user %\u003e!')\n$compiled([ 'user' =\u003e 'fred' ])\n// =\u003e 'hello fred!'\n\n// Use the HTML \"escape\" delimiter to escape data property values.\n$compiled = template('\u003cb\u003e\u003c%- value %\u003e\u003c/b\u003e')\n$compiled([ 'value' =\u003e '\u003cscript\u003e' ])\n// =\u003e '\u003cb\u003e\u0026lt;script\u0026gt;\u003c/b\u003e'\n\n// Use the \"evaluate\" delimiter to execute JavaScript and generate HTML.\n$compiled = template('\u003c% foreach($users as $user) { %\u003e\u003cli\u003e\u003c%- user %\u003e\u003c/li\u003e\u003c% }%\u003e')\n$compiled([ 'users' =\u003e ['fred', 'barney'] ])\n// =\u003e '\u003cli\u003efred\u003c/li\u003e\u003cli\u003ebarney\u003c/li\u003e'\n\n// Use the internal `print` function in \"evaluate\" delimiters.\n$compiled = template('\u003c% print(\"hello \" + $user)%\u003e!')\n$compiled([ 'user' =\u003e 'barney' ])\n// =\u003e 'hello barney!'\n\n// Use backslashes to treat delimiters as plain text.\n$compiled = template('\u003c%= \"\\\\\u003c%- value %\\\\\u003e\" %\u003e')\n$compiled([ 'value' =\u003e 'ignored' ])\n// =\u003e '\u003c%- value %\u003e'\n\n// Use the `imports` option to import functions or classes with aliases.\n$text = '\u003c% all($users, function($user) { %\u003e\u003cli\u003e\u003c%- user %\u003e\u003c/li\u003e\u003c% })%\u003e'\n$compiled = template($text, { 'imports': { '_\\each': 'all' } })\n$compiled([ 'users' =\u003e ['fred', 'barney'] ])\n// =\u003e '\u003cli\u003efred\u003c/li\u003e\u003cli\u003ebarney\u003c/li\u003e'\n\n// Use custom template delimiters.\n\\_::$templateSettings['interpolate'] = '{{([\\s\\S]+?)}}'\n$compiled = template('hello {{ user }}!')\n$compiled([ 'user' =\u003e 'mustache' ])\n// =\u003e 'hello mustache!'\n\n// Use the `source` property to access the compiled source of the template\ntemplate($mainText)-\u003esource;\n\n```\n### toLower\n\nConverts `string`, as a whole, to lower case\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the lower cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\toLower;\n\ntoLower('--Foo-Bar--')\n// =\u003e '--foo-bar--'\n\ntoLower('fooBar')\n// =\u003e 'foobar'\n\ntoLower('__FOO_BAR__')\n// =\u003e '__foo_bar__'\n\n```\n### toUpper\n\nConverts `string`, as a whole, to upper case\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the upper cased string.\n\nExample:\n```php\n\u003c?php\n use function _\\toUpper;\n\ntoUpper('--foo-bar--')\n// =\u003e '--FOO-BAR--'\n\ntoUpper('fooBar')\n// =\u003e 'FOOBAR'\n\ntoUpper('__foo_bar__')\n// =\u003e '__FOO_BAR__'\n\n```\n### trim\n\nRemoves leading and trailing whitespace or specified characters from `string`.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to trim.\n\n@param string $chars The characters to trim.\n\n\n\n**Return:**\n\n@return string Returns the trimmed string.\n\nExample:\n```php\n\u003c?php\n use function _\\trim;\n\ntrim('  abc  ')\n// =\u003e 'abc'\n\ntrim('-_-abc-_-', '_-')\n// =\u003e 'abc'\n\n```\n### trimEnd\n\nRemoves trailing whitespace or specified characters from `string`.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to trim.\n\n@param string $chars The characters to trim.\n\n\n\n**Return:**\n\n@return string Returns the trimmed string.\n\nExample:\n```php\n\u003c?php\n use function _\\trimEnd;\n\ntrimEnd('  abc  ')\n// =\u003e '  abc'\n\ntrimEnd('-_-abc-_-', '_-')\n// =\u003e '-_-abc'\n\n```\n### trimStart\n\nRemoves leading whitespace or specified characters from `string`.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to trim.\n\n@param string $chars The characters to trim.\n\n\n\n**Return:**\n\n@return string Returns the trimmed string.\n\nExample:\n```php\n\u003c?php\n use function _\\trimStart;\n\ntrimStart('  abc  ')\n// =\u003e 'abc  '\n\ntrimStart('-_-abc-_-', '_-')\n// =\u003e 'abc-_-'\n\n```\n### truncate\n\nTruncates `string` if it's longer than the given maximum string length.\nThe last characters of the truncated string are replaced with the omission\nstring which defaults to \"...\".\n\n\nlength = 30 The maximum string length.\nomission = '...' The string to indicate text is omitted.\nseparator The separator pattern to truncate to.\n\n\n\n**Arguments:**\n\n@param string $string The string to truncate.\n\n@param array $options The options object.\n\n\n\n**Return:**\n\n@return string Returns the truncated string.\n\nExample:\n```php\n\u003c?php\n use function _\\truncate;\n\ntruncate('hi-diddly-ho there, neighborino')\n// =\u003e 'hi-diddly-ho there, neighbo...'\n\ntruncate('hi-diddly-ho there, neighborino', [\n'length' =\u003e 24,\n'separator' =\u003e ' '\n])\n// =\u003e 'hi-diddly-ho there,...'\n\ntruncate('hi-diddly-ho there, neighborino', [\n'length' =\u003e 24,\n'separator' =\u003e '/,? +/'\n])\n// =\u003e 'hi-diddly-ho there...'\n\ntruncate('hi-diddly-ho there, neighborino', [\n'omission' =\u003e ' [...]'\n])\n// =\u003e 'hi-diddly-ho there, neig [...]'\n\n```\n### unescape\n\nThe inverse of `escape`this method converts the HTML entities\n`\u0026amp;`, `\u0026lt;`, `\u0026gt;`, `\u0026quot;` and `\u0026#39;` in `string` to\ntheir corresponding characters.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to unescape.\n\n\n\n**Return:**\n\n@return string Returns the unescaped string.\n\nExample:\n```php\n\u003c?php\n use function _\\unescape;\n\nunescape('fred, barney, \u0026amp; pebbles')\n// =\u003e 'fred, barney, \u0026 pebbles'\n\n```\n### upperCase\n\nConverts `string`, as space separated words, to upper case.\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the upper cased string.s\n\nExample:\n```php\n\u003c?php\n use function _\\upperCase;\n\nupperCase('--foo-bar')\n// =\u003e 'FOO BAR'\n\nupperCase('fooBar')\n// =\u003e 'FOO BAR'\n\nupperCase('__foo_bar__')\n// =\u003e 'FOO BAR'\n\n```\n### upperFirst\n\nConverts the first character of `string` to upper case.\n\n\n\n\n**Arguments:**\n\n@param string $string The string to convert.\n\n\n\n**Return:**\n\n@return string Returns the converted string.\n\nExample:\n```php\n\u003c?php\n use function _\\upperFirst;\n\nupperFirst('fred')\n// =\u003e 'Fred'\n\nupperFirst('FRED')\n// =\u003e 'FRED'\n\n```\n### words\n\nSplits `string` into an array of its words.\n\n\n\n\n\n**Arguments:**\n\n@param string $string The string to inspect.\n\n@param string $pattern The pattern to match words.\n\n\n\n**Return:**\n\n@return array Returns the words of `string`.\n\nExample:\n```php\n\u003c?php\n use function _\\words;\n\nwords('fred, barney, \u0026 pebbles')\n// =\u003e ['fred', 'barney', 'pebbles']\n\nwords('fred, barney, \u0026 pebbles', '/[^, ]+/g')\n// =\u003e ['fred', 'barney', '\u0026', 'pebbles']\n\n```\n## Util\n\n### attempt\n\nAttempts to invoke `func`, returning either the result or the caught error\nobject. Any additional arguments are provided to `func` when it's invoked.\n\n\n\n\ns\n**Arguments:**\n\n@param callable $func The function to attempt.\n\n@param array\u003cint, mixed\u003e $args The arguments to invoke `func` with.\n\n\n\n**Return:**\n\n@return (mixed | \\Throwable) Returns the `func` result or error object.\n\nExample:\n```php\n\u003c?php\n use function _\\attempt;\n\n// Avoid throwing errors for invalid PDO data source.\n$elements = attempt(function () {\nnew \\PDO(null);\n});\n\nif (isError($elements)) {\n$elements = [];\n}\n\n```\n### defaultTo\n\nChecks value to determine whether a default value should be returned in its place.\nThe defaultValue is returned if value is NaN or null.\n\n\n\n\n\n\n**Arguments:**\n\n@param mixed $value Any value.\n\n@param mixed $defaultValue Value to return when $value is null or NAN\n\n\n\n**Return:**\n\n@return mixed Returns `value`.\n\nExample:\n```php\n\u003c?php\n use function _\\defaultTo;\n\n$a = null;\n\ndefaultTo($a, \"default\");\n// =\u003e \"default\"\n\n$a = \"x\";\n\ndefaultTo($a, \"default\");\n// =\u003e \"x\"\n\n```\n### identity\n\nThis method returns the first argument it receives.\n\n\n\n\n**Arguments:**\n\n@param mixed $value Any value.\n\n\n\n**Return:**\n\n@return mixed Returns `value`.\n\nExample:\n```php\n\u003c?php\n use function _\\identity;\n\n$object = ['a' =\u003e 1];\n\nidentity($object) === $object;\n// =\u003e true\n\n```\n### property\n\nCreates a function that returns the value at `path` of a given object.\n\n\n\n\n**Arguments:**\n\n@param (array | string) $path The path of the property to get.\n\n\n\n**Return:**\n\n@return callable Returns the new accessor function.\n\nExample:\n```php\n\u003c?php\n use function _\\property;\n\n$objects = [\n[ 'a' =\u003e [ 'b' =\u003e 2 ] ],\n[ 'a' =\u003e [ 'b' =\u003e 1 ] ]\n];\n\nmap($objects, property('a.b'));\n// =\u003e [2, 1]\n\nmap(sortBy($objects, property(['a', 'b'])), 'a.b');\n// =\u003e [1, 2]\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flodash-php%2Flodash-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flodash-php%2Flodash-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flodash-php%2Flodash-php/lists"}