private function formatMemory($size)
    {
        $isNegative = false;
        $unit = ['b', 'kb', 'mb', 'gb', 'tb', 'pb'];

        if (0 > $size) {
            // This is a negative value
            $isNegative = true;
        }

        $return = ($isNegative) ? '-' : '';

        return $return
        .round(
            abs($size) / pow(1024, ($i = floor(log(abs($size), 1024)))), 2
        )
        .' '
        .$unit[$i];
    }
private function formatMemory($size)
    {
        $isNegative = false;
        $unit = ['b', 'kb', 'mb', 'gb', 'tb', 'pb'];

        if (0 > $size) {
            // This is a negative value
            $isNegative = true;
        }

        $return = ($isNegative) ? '-' : '';

        return $return
        .round(
            abs($size) / pow(1024, ($i = floor(log(abs($size), 1024)))), 2
        )
        .' '
        .$unit[$i];
    }
private function formatMemory ( $ size ) { $ isNegative = false ; $ unit = [ 'b' , 'kb' , 'mb' , 'gb' , 'tb' , 'pb' ] ; if ( 0 > $ size ) { // This is a negative value $ isNegative = true ; } $ return = ( $ isNegative ) ? '-' : '' ; return $ return . round ( abs ( $ size ) / pow ( 1024 , ( $ i = floor ( log ( abs ( $ size ) , 1024 ) ) ) ) , 2 ) . ' ' . $ unit [ $ i ] ; }
Format an integer in bytes.

@see http://php.net/manual/en/function.memory-get-usage.php#96280

@param $size

@return string
Format an integer in bytes .