is it possible to do what ifdef allows in c, in php? i'm putting in debugging code which involves creating a file to write to, haveing global $file_hanlde; at the top of all the functions, wrting to the file using the file handle in various functions, etc. this debugging code is all over the place. it'd be nice to be able to remove it from the php execution when not debugging, and be able to turn it all back on again easily and quickly should another problem arise in the future. that's what c's ifdef allows. you wrap bits of code in #ifdef DEBUG
turn on and offable code here
turn on and offable code here
#endif
then define DEBUG at the start of the code, or don't, to turn on or off the turn on and offable code.
how would you do that in php?
thanks.







Bookmarks