It will work perfectly well - .php, .html, .txt, .inc, .whatever:
------8<-------foo.bar-----------8<-------
<?php
echo 'FOO!';
?>
---------------->8------------------------
------8<-----wibble.php----------8<-------
<?php
include('foo.bar');
?>
---------------->8------------------------
It's generally not a good idea to use extensions other than those ending with '.php' for PHP scripts, though, for security reasons.