Why doesn't this code work as a hook?

Hey guys,

I have a quick clarification, so I can learn why this code snippet works one way and not another. I was building an archive drop down menu directly from the Codex, however, I didn't want to place it in a template, I wanted to use a hook.

I use a special include for hooks. I usually wrap all of my hooks within one '<?php ?>'.

This worked:

//* Add archive date sorter bar

function hvw_archive_date_sort() {

	if(is_archive()) {
		?>

			<div class="archive-dropdown">
			<span class="archive-dropdown-title">Sort by Date</span>
			<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
				<option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
				<?php wp_get_archives( array( 'type' => 'monthly', 'format' => 'option', 'show_post_count' => 1 ) ); ?>
			</select>
			</div>

		<?php
	}

}

add_action('genesis_before_loop', 'hvw_archive_date_sort', 10);

This did not work:

//* Add archive date sorter bar

function hvw_archive_date_sort() {

   if(is_archive()) {
	echo '<div class="archive-dropdown"><span class="archive-dropdown-title">Sort by Date</span>
<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value="">' . esc_attr( __( 'Select Month' ) ) . '</option>' . wp_get_archives( array( 'type' => 'monthly', 'format' => 'option', 'show_post_count' => 1 ) ) .
'</select></div>';
	}
}

add_action('genesis_before_loop', 'hvw_archive_date_sort', 10);

For some reason, the 'wp_get_archives' function does not work within an echo, even though I am concatenating it outside of the quotes. The archive months do no get spit out ... it's just blank. I don't get an error, it just doesn't call the data.

The 'wp_get_archives' function spits the data out and works when I break the includes file up using multiple '<?php ?>' and building the structure outside of php.

I just need clarification as to why one works and the other doesn't, for future reference.

Is there some kind of conflict when you try to use a WP Function within an echo?

Cheers!