Pchp.Library.Arrays.reset C# (CSharp) Method

reset() public static method

Moves array intrinsic enumerator so it will point to the first item of the array.
The value returned is dereferenced.
public static reset ( IPhpEnumerable array ) : PhpValue
array IPhpEnumerable The array which intrinsic enumerator to move.
return Pchp.Core.PhpValue
        public static PhpValue reset(IPhpEnumerable array)
        {
            if (array == null)
            {
                //PhpException.ReferenceNull("array");
                return PhpValue.Null;
            }

            // moves to the last item and returns false if there is no such item:
            // TODO: dereferences result since enumerator doesn't do so:
            return (array.IntrinsicEnumerator.MoveFirst())
                ? array.IntrinsicEnumerator.CurrentValue
                : PhpValue.False;
        }