Bird
0
0

Which of the following is the correct syntax for a multi-line comment in PHP?

easy📝 Syntax Q12 of 15
PHP - Basics and Execution Model
Which of the following is the correct syntax for a multi-line comment in PHP?
A/* This is a multi-line comment */
B// This is a multi-line comment
C# This is a multi-line comment
D<!-- This is a multi-line comment -->
Step-by-Step Solution
Solution:
  1. Step 1: Recall multi-line comment syntax in PHP

    PHP uses /* ... */ to write multi-line comments.
  2. Step 2: Evaluate each option

    /* This is a multi-line comment */ correctly uses /* ... */. Options B and C are single-line comment styles. is HTML comment syntax.
  3. Final Answer:

    /* This is a multi-line comment */ -> Option A
  4. Quick Check:

    Multi-line comment = /* ... */ [OK]
Quick Trick: Multi-line comments use /* at start and */ at end [OK]
Common Mistakes:
  • Using // or # for multi-line comments
  • Confusing HTML comments with PHP comments
  • Forgetting to close multi-line comment with */

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes