<?php
/*
/* this is a comment */
*/
?>
PHP returns "syntax error"... Is this just a completely wrong way to use multiple line comment?
Sometimes I need to comment out a big block of code for testing, and this block contains hundreds of lines and there are many multiple line comments inside.
What's the best way to comment out this big block? Besides removing it temporarily from the file?
To comment out multiple lines in Python, you can prepend each line with a hash ( # ). With this approach, you're technically making multiple single-line comments. The real workaround for making multi-line comments in Python is by using docstrings.
Multi-line comments start with /* and end with */ . Any text between /* and */ will be ignored by JavaScript.
PHP supports both one-line and multi-line comments. A one-line comment starts with the # or // . A multi-line comment starts with /* and end with */ .
From the PHP manual:
'C' style comments end at the first */ encountered. Make sure you don't nest 'C' style comments. It is easy to make this mistake if you are trying to comment out a large block of code.
<?php /* echo 'This is a test'; /* This comment will cause a problem */ */ ?>
:(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With