Which of the following statement produce different output
-
<?echo "This is php example"; ?>
-
<P="This is php example"; ?>
-
<?PHP echo "This is php example"; php?>
-
<script language="php"> print "This is php example";</script>
This question asks which statement is DIFFERENT. Options A, B, and D are valid PHP output statements that would print 'This is php example'. Option C has 'php?>' instead of '?>' at the end, making it a syntax error that would fail to execute, thus producing different output (an error) compared to the others.
The marked answer, , uses a malformed closing tag ('php?>' instead of the standard '?>'), so unlike the other options — which use valid or historically valid PHP tag styles (short open tags ' ?>' and the old block, both supported in early PHP) — this one would trigger a parse error or fail to close the PHP block, producing broken/different output. That said, option B (<P="..."; ?>) is also not valid PHP or HTML syntax and would likely render as literal broken text, so the premise that exactly one option differs is questionable — the sample code appears garbled/typo-corrupted in the source material, making full confidence in a single answer difficult.