Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199807

RE: [PHP3] #ifdef and #endif From: Zeev Suraski (bourbon <email protected>)
Date: 07/22/98

Using constants is much, much nicer for this purpose. No dollar signs
necessary, and they have global scope.

        define("DEBUG_MODE",1);

        function debugmsg($str) {
                if (DEBUG_MODE) {
                        print("DEBUG: $str<BR>\n");
                }
        }

        $value = somefunc();
        debugmsg("\$value = $value");

Zeev

At 08:59 22/07/98 -0400, Brian Schaffner wrote:
><?
> $DEBUG_MODE = 1;
>
> function debugmsg($str) {
> global $DEBUG_MODE;
> if ($DEBUG_MODE) {
> print("DEBUG: $str<BR>\n");
> }
> }
>
> $value = somefunc();
> debugmsg("\$value = $value");
>?>
>
>Of course, there's always comments!
>
>Brian Schaffner, Manager of Internet Services
>ACCENT Marketing Services, Inc.
>
>-----Original Message-----
>From: Walter Dougoveto [mailto:wdougoveto <email protected>]
>Sent: Wednesday, July 22, 1998 8:27 AM
>To: php3 <email protected>
>Subject: [PHP3] #ifdef and #endif
>
>
>I was just wondering if there was anything like the #ifdef and #endif in
>C
>that you could use with PHP for debugging? If not, what would you
>suggest?
> I have been adding statements for debugging and then taking them out
>but
>it is not very efficient. It would be good to have a way to turn them
>on
>or off using one statement.
>
>Thanks,
>
>Walter
>
>--
>PHP 3 Mailing List http://www.php.net/
>To unsubscribe send an empty message to php3-unsubscribe <email protected>
>To subscribe to the digest list: php3-digest-subscribe <email protected>
>For help: php3-help <email protected> Archive:
>http://www.php.net/mailsearch.php3
>
>
>--
>PHP 3 Mailing List http://www.php.net/
>To unsubscribe send an empty message to php3-unsubscribe <email protected>
>To subscribe to the digest list: php3-digest-subscribe <email protected>
>For help: php3-help <email protected> Archive:
http://www.php.net/mailsearch.php3
>
>
>

--
Zeev Suraski   <zeev <email protected>>
For a PGP public key, finger bourbon <email protected>

-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3