-
-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathEqual.php
More file actions
27 lines (24 loc) · 539 Bytes
/
Copy pathEqual.php
File metadata and controls
27 lines (24 loc) · 539 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
/**
* @package Functional-php
* @author Lars Strojny <lstrojny@php.net>
* @copyright 2011-2021 Lars Strojny
* @license https://opensource.org/licenses/MIT MIT
* @link https://github.com/lstrojny/functional-php
*/
namespace Functional;
/**
* Performs an equal comparison
*
* @param mixed $b the value to compare to
*
* @return callable(mixed):bool the function to perform the comparison
*
* @no-named-arguments
*/
function equal($b)
{
return function ($a) use ($b) {
return $a == $b;
};
}