public static int array_unshift(PhpArray array, params PhpValue[] vars)
{
if (array == null)
{
//PhpException.ReferenceNull("array");
//return 0;
throw new ArgumentNullException();
}
// reindexes integer keys starting from the number of items to be prepended:
array.ReindexIntegers(vars.Length);
// prepends items indexing keys from 0 to the number of items - 1:
for (int i = vars.Length - 1; i >= 0; i--)
{
array.Prepend(i, vars[i]);
}
return array.Count;
}