internal static PhpArray StringKeysToUpper(PhpArray/*!*/ array)
{
if (array == null)
{
//PhpException.ArgumentNull("array");
//return null;
throw new ArgumentNullException();
}
var textInfo = System.Globalization.CultureInfo.CurrentCulture.TextInfo; // cache current culture to avoid repetitious CurrentCulture.get
PhpArray result = new PhpArray(array.Count);
using (var iterator = array.GetFastEnumerator())
while (iterator.MoveNext())
{
var entry = iterator.Current;
if (entry.Key.IsString)
result[textInfo.ToUpper(entry.Key.String)] = entry.Value;
else
result[entry.Key] = entry.Value;
}
return result;
}