Which of following commenting is supported by Php

  1. Single line c++ syntax - //

  2. Shell syntax - #

  3. Both of above

  4. None of above


Correct Option: C

AI Explanation

To answer this question, you need to have knowledge about the syntax and commenting options available in PHP.

Option A) Single line C++ syntax - //

This option is correct. PHP supports single-line comments using the double forward slash (//) syntax, similar to the C++ language.

Option B) Shell syntax - #

This option is also correct. PHP supports single-line comments using the hash symbol (#) syntax, which is commonly used in shell scripting.

Option C) Both of above

This option is correct. PHP supports both single-line C++ syntax (//) and shell syntax (#) for commenting.

Option D) None of above

This option is incorrect. PHP does support both single-line C++ syntax (//) and shell syntax (#) for commenting.

Therefore, the correct answer is C) Both of above. This option is correct because PHP supports both single-line C++ syntax (//) and shell syntax (#) for commenting.

Find more quizzes: