public static PhpValue key(IPhpEnumerable array)
{
if (array == null)
{
//PhpException.ReferenceNull("array");
//return null;
throw new ArgumentNullException();
}
if (array.IntrinsicEnumerator.AtEnd)
return PhpValue.Null;
// note, key can't be of type PhpReference, hence no dereferencing follows:
return array.IntrinsicEnumerator.CurrentKey.GetValue();
}