public static function arrayDiff($array1, $array2) {
        return array_udiff($array1, $array2,
            function ($a, $b) {
                if (is_object($a)) {
                    return strcmp(spl_object_hash($a), spl_object_hash($b));
                } else if (is_array($a)) {
                    return ArrayUtils::arrayDiff($a, $b);
                } else {
                    return strcmp($a, $b);
                }
            }
        );
    }
public static function arrayDiff($array1, $array2) {
        return array_udiff($array1, $array2,
            function ($a, $b) {
                if (is_object($a)) {
                    return strcmp(spl_object_hash($a), spl_object_hash($b));
                } else if (is_array($a)) {
                    return ArrayUtils::arrayDiff($a, $b);
                } else {
                    return strcmp($a, $b);
                }
            }
        );
    }
public static function arrayDiff ( $ array1 , $ array2 ) { return array_udiff ( $ array1 , $ array2 , function ( $ a , $ b ) { if ( is_object ( $ a ) ) { return strcmp ( spl_object_hash ( $ a ) , spl_object_hash ( $ b ) ) ; } else if ( is_array ( $ a ) ) { return ArrayUtils :: arrayDiff ( $ a , $ b ) ; } else { return strcmp ( $ a , $ b ) ; } } ) ; }
Diff function for arrays which works with arrays of objects as well as string comparables.

@param $array1
@param $array2
Diff function for arrays which works with arrays of objects as well as string comparables .