src/snac/data/AbstractData.php
/**
     * Array Equality
     *
     * Checks that two arrays are equal.  Specifically, tests that the second array has all
     * the same objects as the first.
     *
     * @param \snac\data\AbstractData[] $first first array
     * @param \snac\data\AbstractData[] $second second array
     * @param boolean $strict optional whether or not to check ID/Version/Operation
     * @param boolean $checkSubcomponents optional Whether or not to check SNACControlMetadata, nameEntries contributors & components
     * @return boolean true if equal, false otherwise
     */
Array Equality
Checks that two arrays are equal.  Specifically, tests that the second array has all
the same objects as the first.


Array Equality Checks that two arrays are equal . Specifically tests that the second array has all the same objects as the first .
protected function checkArrayEqual($first, $second, $strict = true, $checkSubcomponents = true) {
        if ($first == null && $second == null)
            return true;
        if ($first == null || $second == null)
            return false;
        if (count($first) != count($second))
            return false;
        $tmp = array();
        foreach ($first as $data) {
            foreach ($second as $k => $odata) {
                if ((($data == null && $odata == null) || ($data != null && $data->equals($odata, $strict, $checkSubcomponents)))
                        && !isset($tmp[$k])) {
                    $tmp[$k] = true;
                }
            }
        }
        $count = count($tmp);
        unset($tmp);
        if ($count != count($second))
            return false;
        return true;
    }
protected function checkArrayEqual ( $ first , $ second , $ strict = true , $ checkSubcomponents = true ) { if ( $ first == null && $ second == null ) return true ; if ( $ first == null || $ second == null ) return false ; if ( count ( $ first ) != count ( $ second ) ) return false ; $ tmp = array ( ) ; foreach ( $ first as $ data ) { foreach ( $ second as $ k => $ odata ) { if ( ( ( $ data == null && $ odata == null ) || ( $ data != null && $ data -> equals ( $ odata , $ strict , $ checkSubcomponents ) ) ) && ! isset ( $ tmp [ $ k ] ) ) { $ tmp [ $ k ] = true ; } } } $ count = count ( $ tmp ) ; unset ( $ tmp ) ; if ( $ count != count ( $ second ) ) return false ; return true ; }
Array Equality
 Checks that two arrays are equal.
Array Equality Checks that two arrays are equal .