public function equals($obj)
    {
        if ($obj instanceof QtiFile) {
            if ($this->getFilename() !== $obj->getFilename()) {
                return false;
            } elseif ($this->getMimeType() !== $obj->getMimeType()) {
                return false;
            } else {
                // We have to check the content of the file.
                $myStream = $this->getStream();
                $objStream = $obj->getStream();

                while (feof($myStream) === false && feof($objStream) === false) {
                    $myChunk = fread($myStream, self::CHUNK_SIZE);
                    $objChjunk = fread($objStream, self::CHUNK_SIZE);

                    if ($myChunk !== $objChjunk) {
                        @fclose($myStream);
                        @fclose($objStream);

                        return false;
                    }
                }

                @fclose($myStream);
                @fclose($objStream);

                return true;
            }
        }

        return false;
    }
public function equals($obj)
    {
        if ($obj instanceof QtiFile) {
            if ($this->getFilename() !== $obj->getFilename()) {
                return false;
            } elseif ($this->getMimeType() !== $obj->getMimeType()) {
                return false;
            } else {
                // We have to check the content of the file.
                $myStream = $this->getStream();
                $objStream = $obj->getStream();

                while (feof($myStream) === false && feof($objStream) === false) {
                    $myChunk = fread($myStream, self::CHUNK_SIZE);
                    $objChjunk = fread($objStream, self::CHUNK_SIZE);

                    if ($myChunk !== $objChjunk) {
                        @fclose($myStream);
                        @fclose($objStream);

                        return false;
                    }
                }

                @fclose($myStream);
                @fclose($objStream);

                return true;
            }
        }

        return false;
    }
public function equals ( $ obj ) { if ( $ obj instanceof QtiFile ) { if ( $ this -> getFilename ( ) !== $ obj -> getFilename ( ) ) { return false ; } elseif ( $ this -> getMimeType ( ) !== $ obj -> getMimeType ( ) ) { return false ; } else { // We have to check the content of the file. $ myStream = $ this -> getStream ( ) ; $ objStream = $ obj -> getStream ( ) ; while ( feof ( $ myStream ) === false && feof ( $ objStream ) === false ) { $ myChunk = fread ( $ myStream , self :: CHUNK_SIZE ) ; $ objChjunk = fread ( $ objStream , self :: CHUNK_SIZE ) ; if ( $ myChunk !== $ objChjunk ) { @ fclose ( $ myStream ) ; @ fclose ( $ objStream ) ; return false ; } } @ fclose ( $ myStream ) ; @ fclose ( $ objStream ) ; return true ; } } return false ; }
Whether or not two File objects are equals. Two File values
are considered to be identical if they have the same file name,
mime-type and data.

@return boolean
Whether or not two File objects are equals . Two File values are considered to be identical if they have the same file name mime - type and data .