Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the annotation styles supported by php

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "what are the annotation styles supported by php?", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what are the annotation styles supported by php".

Php language supports three annotation styles: 1, C++ style, using "/ /" symbol, syntax "/ / comment content"; 2, C language style, using "/ * * /" symbol, grammar "/ * comment content * /"; 3, Shell style (Perl style), using "#" symbol, syntax "# comment content".

Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

PHP supports three annotation styles: Cregorian + and Unix Shell style (Perl style)

① single-line comments (C++ style), symbol: / /

② multiline comments (C style), symbol: / * /

③ special single-line comments (not commonly used, Shell style), symbol: #

1. Notes on C++ style (/ /)

This kind of comment cannot appear? > tag. If short_open and asp_tag settings are turned on, > and% > cannot appear in the comment either.

2. C language style (/ * /), nested annotations are not allowed

C-style comments end when they encounter the first "* /", so multiline comments cannot be nested, otherwise a syntax error will be reported.

3. Shell style (#), same as the ban on C++

The three annotation styles are as follows

Note: single-line comments are only commented to the end of the line or the current PHP code block (there is "? >" at the end of the line and will not be commented. PHP will jump out of PHP mode when it encounters "? >", followed by parsing HTML code or other)

The above is about the content of this article on "what are the annotation styles supported by php". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report