Bird
0
0

Find the problem in this PHP code:

medium📝 Debug Q7 of 15
PHP - Request Lifecycle
Find the problem in this PHP code:
<?php
 echo 'Test';
 ?>
AClosing tag is incomplete; should be ?>.
BEcho statement missing parentheses.
CMissing semicolon after closing tag.
DNo problem; code runs correctly.
Step-by-Step Solution
Solution:
  1. Step 1: Inspect opening and closing tags

    The code starts with <?php and ends with ?>, which is missing the final '>' character to form a proper closing tag '?>'.
  2. Step 2: Effect of incomplete closing tag

    This incomplete closing tag can cause a parse error or unexpected behavior because PHP expects '?>' to close the block.
  3. Final Answer:

    Closing tag is incomplete; should be ?>. -> Option A
  4. Quick Check:

    PHP closing tag must be complete as ?> [OK]
Quick Trick: PHP closing tag must be complete as ?> [OK]
Common Mistakes:
  • Writing ?> instead of ?>
  • Thinking semicolon needed after closing tag
  • Confusing echo syntax with tag syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes