Concept
How are single-line and multiline comments handled in PHP?
ComputerScienceOne / Entry Point & Command Line Arguments
"37. Basics slashes is ignored. With a multiline comment, everything in between the forward slash/asterisk is ignored. Comments are ultimately ignored by the interpreter. Consider the following example. 1 //this is a single line comment 2 $x = 10; //this is also a single line comment, but after some code 3 4 /* 5 This is a comment that can 6 span multiple lines to format the comment 7 message more clearly 8 */ 9 $y = 3.14; Most code editors and IDEs will present comments in a special color or font to distinguish them from the rest of the code (just as our example above does). Failure to close a multiline comment will likely result in a fatal interpreter error but with color-coded comments its easy to see the mistake visually."
Related Ideas
- How are comments written in PHP code?ComputerScienceOne · PHP Tags
- How are comments written and used in a C program?ComputerScienceOne · Comments
- How are comments written and processed in Java?ComputerScienceOne · Comments
- How are comments written and treated in Java programs?ComputerScienceOne · The javamain() Method
- How can color-coded comments reveal a multiline comment mistake?ComputerScienceOne · The cmain() Function
- How are strings, statements, and code blocks written in PHP?ComputerScienceOne · Basic Syntax Rules
- What are the main characteristics of PHP as a programming language?ComputerScienceOne · Basic Syntax Rules
- How are variables and variable types handled in PHP?ComputerScienceOne · Entry Point & Command Line Arguments