public static function writeObject($filePath, $object, $compareContents = false)
    {
        $content = '<?php return ' . var_export($object, true) . ';';
        return self::write($filePath, $content, $compareContents);
    }
public static function writeObject($filePath, $object, $compareContents = false)
    {
        $content = '<?php return ' . var_export($object, true) . ';';
        return self::write($filePath, $content, $compareContents);
    }
public static function writeObject ( $ filePath , $ object , $ compareContents = false ) { $ content = '<?php return ' . var_export ( $ object , true ) . ';' ; return self :: write ( $ filePath , $ content , $ compareContents ) ; }
Writes string representation of PHP object into plain file

@param $filePath
@param $object
@param bool $compareContents     Determines if new content should be compared with the
current file content. When contents are the same, then
new content will not be written to the file.
@return int                      Number of bytes that were written to the file
Writes string representation of PHP object into plain file