Closed
Description
Given the following phpunit test case:
$integers = [3, 1, 2];
$sort = [];
foreach ($integers as $k => $value) {
$sort[$k][] = $value;
}
array_multisort($sort, SORT_ASC, $integers);
Assert::assertSame(1, $integers[0]);
Assert::assertSame(2, $integers[1]);
Assert::assertSame(3, $integers[2]);
it passes with php's native array_mulitsort
. Using Safe\array_multisort
it fails, though. The array $integers
is left unchanged. In the documentation (and therefore in safe) the third parameter is not a reference while php actually treats it as one.
Metadata
Metadata
Assignees
Labels
No labels