$builder->where( [ 'x' => [ 1, 2 ] ] ); $builder->andWhere( [ 'x' => [ 2, 3 ] ] );
The expected outcome is that WHERE x IN (1, 2) AND x IN (2, 3) but the actual outcome is WHERE x IN (2, 3) as array_merge overwrites the previous condition for the same field name. This is especially problematic when a query builder is passed into a hook or other extension-defined callback.