'foo', 'b' => 'bar', 'c' => 'baz', 'd' => 'qux', 'e' => 'lax']; $expected = [$a, $b, $c]; $array = [$b, $c, $a]; $scalar_fun = /** * @param array $arr * * @psalm-pure */ static fn (array $arr): int => Iter\count($arr); return [ [ $expected, $array, $scalar_fun, ], [ ['a', 'b', 'c', 'd'], ['d', 'a', 'b', 'c'], /** * @psalm-pure */ static fn (string $v): string => $v, ], [ ['a'], ['a'], /** * @psalm-pure */ static fn (string $v): string => $v, ], [ ['d', 'c', 'b', 'a'], ['d', 'a', 'b', 'c'], /** * @psalm-pure */ static fn (string $v): string => $v, /** * @psalm-pure */ static fn (string $a, string $b): int => Str\ord($a) > Str\ord($b) ? -1 : 1, ], [ ['bar', 'qux'], ['foo' => 'bar', 'baz' => 'qux'], /** * @psalm-pure */ static fn (string $v): string => $v, ], [ ['jumped', 'the', 'quick', 'brown', 'fox'], ['the', 'quick', 'brown', 'fox', 'jumped'], /** * @psalm-pure */ static fn (string $v): string => Str\Byte\reverse($v), ], ]; } }