Bird
0
0

Identify the error in this PHP code:

medium📝 Debug Q6 of 15
PHP - Output and String Handling
Identify the error in this PHP code:
print("Hello World")
Aprint cannot use parentheses
BNo error, code is correct
CQuotes should be single quotes
DMissing semicolon at the end
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax

    PHP statements must end with a semicolon (;).
  2. Step 2: Verify parentheses and quotes

    print can use parentheses and either quote type is valid.
  3. Final Answer:

    Missing semicolon at the end -> Option D
  4. Quick Check:

    Semicolon required = B [OK]
Quick Trick: Always end PHP statements with semicolon [OK]
Common Mistakes:
  • Omitting semicolon
  • Thinking parentheses are forbidden
  • Confusing quote types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes