Example scenario:
Let's say I have a page that is generated by includes, and even has a loop:
<? require_once 'classes/classe1.class.php'; ?>
<html>
<head>
<? include_once 'html/head.php'; ?>
</head>
<body>
<? foreach ($array as $v) { ?>
<tr>
<td><? echo $v['X'] ?></td>
<td><? echo $v['Y'] ?></td>
</tr>
<? } ?>
</body>
</html>
In the example, I show 2 ways to open and close the php
I see around between users of the language. The former ends with ;
and the others do not:
<? require_once 'classes/classe1.class.php'; ?>
<? include_once 'html/head.php'; ?>
and
<td><? echo $v['X'] ?></td>
<td><? echo $v['Y'] ?></td>
Questions:
- Should I close the code even though it is closing or would it be indifferent ?
- Is the opening and closing of the stretch already considered processing end ?
- Could interfere with any part of the script?
- Is it a good practice ?