If you're using php code in between html code like below :
<html><head><title>Test</title></head><body><?phpecho "Hello";?></body></html>
Then,it should have closing tag (?>).But,if you're entering only php code in it then without closing too it would run like below:
<?phpecho "Hello";?>
Hope this got you a answer !