The uasort() function of the ArrayObject class in PHP is used to sort values of an ArrayObject according to a user defined comparison function. The function compares and arranges the values present in the ArrayObject according to the given comparison function. This method does not affects the key-value associations.
Parameters: This function accepts a single parameter $comparator which is the user defined comparison function. This comparison function in turn accepts two arguments which are the values of the ArrayObject and returns less than, equals to or greater than zero if the first argument is less than, equals to or greater than zero respectively.
Return Value: This function does not returns any value.
Below program illustrate the above function:
ArrayObject Object ( [storage:ArrayObject:private] => Array ( [GfG] => 3 [to] => 2 [Welcome] => 1 ) )