Bird
0
0

Identify the error in this PHP code:

medium📝 Debug Q14 of 15
PHP - Output and String Handling
Identify the error in this PHP code:
print "Hello World"
AMissing semicolon at the end
BQuotes should be single quotes
Cprint should be uppercase
DMissing parentheses around text
Step-by-Step Solution
Solution:
  1. Step 1: Check statement ending

    PHP statements must end with a semicolon; this code misses it.
  2. Step 2: Verify other syntax parts

    Quotes can be single or double, print is case-insensitive, parentheses optional.
  3. Final Answer:

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

    Semicolon missing = syntax error [OK]
Quick Trick: Always end print statements with a semicolon [OK]
Common Mistakes:
  • Forgetting semicolon at line end
  • Thinking print must be uppercase
  • Adding unnecessary parentheses

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes