Skip to content

Commit 9e8363e

Browse files
committed
Avoid double declaration of Functional\match (e.g. for preloading)
1 parent 4924870 commit 9e8363e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Functional/Matching.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function matching(array $conditions)
2929
{
3030
MatchException::assert($conditions, __FUNCTION__);
3131

32-
return function ($value) use ($conditions) {
32+
return static function ($value) use ($conditions) {
3333
if (empty($conditions)) {
3434
return null;
3535
}
@@ -41,7 +41,7 @@ function matching(array $conditions)
4141
}
4242

4343

44-
if (PHP_VERSION_ID < 80000) {
44+
if (PHP_VERSION_ID < 80000 && !function_exists('Functional\match')) {
4545
eval(<<<'ALIAS'
4646
namespace Functional;
4747

0 commit comments

Comments
 (0)