You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the opening <?php tag is on the first line of the file, it must be on its own line with no other statements unless it is a file containing markup outside of PHP opening and closing tags.
5
+
]]>
6
+
</standard>
7
+
<code_comparison>
8
+
<codetitle="Valid: Opening PHP tag on a line by itself.">
9
+
<![CDATA[
10
+
<em><?php</em>
11
+
12
+
echo 'hi';
13
+
]]>
14
+
</code>
15
+
<codetitle="Invalid: Opening PHP tag not on a line by itself.">
16
+
<![CDATA[
17
+
<?php <em>echo 'hi';</em>
18
+
]]>
19
+
</code>
20
+
</code_comparison>
21
+
<code_comparison>
22
+
<codetitle="Valid: Opening PHP tag not on a line by itself, but has markup outside the closing PHP tag.">
23
+
<![CDATA[
24
+
<?php declare(strict_types=1); ?>
25
+
<html>
26
+
<body>
27
+
<?php
28
+
// ... additional PHP code ...
29
+
?>
30
+
</body>
31
+
</html>
32
+
]]>
33
+
</code>
34
+
<codetitle="Invalid: Opening PHP tag not on a line by itself without any markup in the file.">
0 commit comments