diff --git a/src/cl.php b/src/cl.php index 9e406a4..a0fc0dd 100644 --- a/src/cl.php +++ b/src/cl.php @@ -336,7 +336,10 @@ class cl { static final function merge2(...$arrays): ?array { $merged = null; foreach ($arrays as $array) { - foreach (self::with($array) as $key => $value) { + $array = self::withn($array); + if ($array === null) continue; + $merged ??= []; + foreach ($array as $key => $value) { $merged[$key] = $value; } }