I don't know where to post bugs that I find in Dreamweaver 8, so I will write
it here.

I have a header.php file with document type and encoding declaration.

I include it in my index.php file using
include('header.php');

What should happen is that when I open index.php the doctype from header will
automatically load and display after the filename on Dreamweaver title bar. So
it should be "index.php (XHTML)".

For some strange reason it only happens if I include header like this:
<? include('header.php'); ?>

When instead of that the beginning of index.php file looks like that:
<? include('header.php');
include('another_file.php'); ?>
which actually means any php command instead of ?> after the first include.
Doctype detecting does not work.

This is very strange and I cannot see any explanation for this except that it
have to be a bug. And bugs should be fixed.