Which of following commenting is supported by Php
-
Single line c++ syntax - //
-
Shell syntax - #
-
Both of above
-
None of above
PHP supports both C++ single-line comments starting with // and shell/Perl style single-line comments starting with #. Thus, both commenting styles are supported.
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.