When I first started writing PHP code, I was about to write PHP closed labels. I used to change it later and didn't write PHP closed labels anymore. This concept was first introduced from Drupal. at the beginning, I was a little unaccustomed to writing PHP code. When I first started writing PHP code, I wanted to write PHP closed labels, and then I used to change it, PHP closed labels are no longer written. This concept was first introduced in Drupal and was a bit unaccustomed at the beginning-why not write a closed tag? This is not perfect. it is not suitable for people with obsessive-compulsive disorder! Later, I encountered a problem caused by Tag closure in my work, so I started not to write the closed tag.
For PHP files, the reason for not writing closed labels is to prevent redundant spaces and tabs after the closed labels. these extra characters will be output during page rendering, resulting in page dislocation; it is also possible that you include another php file in a php file and use the header function. in Another PHP file, the closed tag contains additional characters, in this case, an error is reported because the output is performed before the header function. Therefore, we strongly recommend that you do not write close tags in php files.
This is also mentioned in Zend's code specification: http://framework.zend.com/manual/1.12/en/coding-standard.php-file-formatting.html