note 13803 added to pear.standards.comments.php

From: Date: Tue, 03 Jul 2001 20:52:02 +0000
Subject: note 13803 added to pear.standards.comments.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-14948@lists.php.net to get a copy of this message
About debug information - This is (in a short) what I do: <?php define("VERBOSE",_1); $A_DEBUG_=_array();_//_global,_set_by_debug(),_displayed_via_show_debug() function_DEBUG($msg) { ____global_$A_DEBUG;_//_is_an_array ____if_(VERBOSE)_$A_DEBUG[]_=_$msg;_//_adding }_//_DEBUG() function_SHOW_DEBUG { ____global_$A_DEBUG;_//_is_an_array ____if_(VERBOSE)_print_r($A_DEBUG); }_//_SHOW_DEBUG DEBUG("started"); LOT_OF_CODE(); DEBUG("finished"); SHOW_DEBUG(); ?> If I don't need debug-information any longer I just delete all lines containing "DEBUG". I use uppercase, because lines containing "debug" will stay untouched (p.e. comments). -- BTW Why write "if" and "{" in a single line and "function" and "{" not? I for myself put "{" and "}" in a line without any other code before or after - except comments after "}". Stay cool, don't close the fridge. http://www.php.net/manual/en/pear.standards.comments.php

« previous php.notes (#14948) next »