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

uksort() public static method

Sorts an array using user comparison callback for comparing keys.
Resets array's intrinsic enumerator.
public static uksort ( Context ctx, [ array, IPhpCallable compare ) : bool
ctx Pchp.Core.Context Current runtime context.
array [ The array to be sorted.
compare IPhpCallable The user callback to be used for comparison of values.
return bool
        public static bool uksort(Context ctx /*, caller*/, [In, Out] PhpArray array, IPhpCallable compare)
        {
            if (array == null)
            {
                //PhpException.ReferenceNull("array");
                //return false;
                throw new ArgumentNullException();
            }
            if (!PhpVariable.IsValidCallback(compare)) return false;

            array.Sort(new KeyComparer(new PhpUserComparer(ctx, compare), false));

            return true;
        }