Hi,

Here is something I used to do in C/C++ to include/exclude automaticaly all debugging code at compiling time:

#define debug TRUE
#ifdef(debug)
        //debugging code
#endif

That way I can include/exclude easily all debugging code in the final compiled code. In PHP I have not been able to find anything like that. The only solution I've found is having this kind of code in every debug code block:

if ($debug) {
        //debugging code
}

But this means that the debugging code is in the final compiled (interpreted) code, wasting cpu cycles even if there won't be any debugging in production.

Does somebody know if there is something like conditional compilation in PHP that I can use?

Regards,
Herman Gomez
Madrid, Spain.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to