I started to play with Syntax Highlighting today: I came across this : http://wordpress.org/extend/plugins/wp-syntax/ Seems to work nicely but you have to be in HTML Mode and if you switch back and forth you can loose your code snippet.

I ended up disabling the Visual Editor, which of course i can re enable for future posts. Below is a Test:

<div id="foo">
<?php
  function foo() {
    echo "Hello World!\\n";
  }
?>
</div>