private static PhpArray GetGroupingArray(int[] groups)
{
Debug.Assert(groups != null);
int length = groups.Length;
PhpArray result = new PhpArray(length, 0);
for (int i = 0; i < length; i++)
if (groups[i] == 0)
result.Add(i, CHAR_MAX);
else
result.Add(i, groups[i]);
return result;
}