Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add array_udiff to arrayFunctions.stub
- Loading branch information
1 parent
ef8c7c3
commit 98a3b07
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
array_udiff( | ||
[1,2,3], | ||
[4,5,6], | ||
function(string $a, string $b): string { | ||
return $a . $b; | ||
}, | ||
); | ||
|
||
array_udiff( | ||
[1,2,3], | ||
[4,5,6], | ||
function(int $a, int $b): string { | ||
return $a . $b; | ||
}, | ||
); | ||
|
||
array_udiff( | ||
null, | ||
null, | ||
function(string $a, int $b): string { | ||
return $a . $b; | ||
}, | ||
); | ||
|
||
array_udiff( | ||
[25,26], | ||
[26,27], | ||
static function(int $a, int $b): int { | ||
return $a <=> $b; | ||
}, | ||
); | ||
|