User Contributed Notes 21 notes

Notes can come in all sorts of shapes and sizes. They vary, and their uses are completely up to the person writing the code. However, I try to keep things consistent in my code that way it's easy for the next person to read. So something like this might help...

Comments in PHP can be used for several purposes, a very interesting one being that you can generate API documentation directly from them by using PHPDocumentor (http://www.phpdoc.org/).

Therefor one has to use a JavaDoc-like comment syntax (conforms to the DocBook DTD), example:<?php/*** The second * here opens the DocBook commentblock, which could later on<br>* in your development cycle save you a lot of time by preventing you having to rewrite<br>* major documentation parts to generate some usable form of documentation.*/?>Some basic html-like formatting is supported with this (ie <br> tags) to create something of a layout.

it's perhaps not obvious to some, but the following code will cause a parse error! the ?> in //?> is not treated as commented text, this is a result of having to handle code on one line such as <?php echo 'something'; //comment ?>

<?phpif(1==1){//?>}?>

i discovered this "anomally" when i commented out a line of code containing a regex which itself contained ?>, with the // style comment.e.g. //preg_match('/^(?>c|b)at$/', 'cat', $matches);will cause an error while commented! using /**/ style comments provides a solution. i don't know about # style comments, i don't ever personally use them.

a trick I have used in all languages to temporarily block out large sections (usually for test/debug/new-feature purposes), is to set (or define) a var at the top, and use that to conditionally comment the blocks; an added benefit over if(0) (samuli's comment from nov'05) is that u can have several versions or tests running at once, and u dont require cleanup later if u want to keep the blocks in: just reset the var.

personally, I use this more to conditionally include code for new feature testing, than to block it out,,,, but hey, to each their own :)

this is also the only safe way I know of to easily nest comments in any language, and great for multi-file use, if the conditional variables are placed in an include :)

for example, placed at top of file:

<?php $ver3 = TRUE; $debug2 = FALSE; ?>

and then deeper inside the file:

<?php if ($ver3) { print("This code is included since we are testing version 3"); }?>

colleague fastened her shoulder and arm with restraint straps after connecting her ventilator tubing again. She looked at me desperately shaking his head, tears flowing slowly along the cheek. I know she can not stand it, not only because of the physical pain, but also because her husband drank poison for her

the tears raging and the entire pillow wet. The heartbeat on the ECG, 129 beats per minute, seemed the only evidence that she had witnessed her husband's death. From her point of view, I can see her husband's head is covered with white cloth. Suddenly, the alarm of ventilator and ECG monitoring sounded at the same time. http://tilzit-fishing.ru/ Female patients exhausted their mouth to pull out the breathing machine pipe, which is tantamount to suicide

The child tugged at his grandmother's hand tightly and involuntarily dodged in the corner. He did not know what happened and did not know what was going to happen, leaving only fear in his eyes. Female patient lying on the bed, breathing exhausted with breathing machine, quietly watching the bed next door to her husband was pulled on the bed curtain, the medical staff inside the husband to implement the rescue, until once again opened the curtain, all the rescue http://www.geizersamara.ru/ Evacuate personnel and equipment, her husband took the first step, declared dead. She could not speak - the ventilator was inserted into the esophagus, and I could only see her facial expressions were distorted

He opened in Paris in 1854 in his name named the first suitcase shop., I introduce you to <a href="http://www.topwatchesuk.co.uk" title="replica watches">replica watches</a>introduce the color of sweet and sour pork ribs.so that you look at the eyes of the <a href="http://www.dreamforwatches.org.uk" title="rolex replica">rolex replica</a>golden light; so that you will be buried after the <a href="http://www.acornpc.co.uk" title="replica watches uk">replica watches uk</a>mouth will be saliva;"Louis Vuitton" has become the world's first brand in the field of luggage and leather goods, and become a symbol of high society.