I have looked for a definitive answer for this and have not found one.
"sometimes, when it works" is not getting very far in designing a
solution. Maybe the question should be "WHERE can PHP be mixed inline in
the file?"
for example, a file called xxx.html, marked
DocType -//W3C//DTD HTML 4.01 Transitional//EN
the server can execute PHP, I am using PHP v.4.4.0