code_junkie

Does PHP have a DEBUG symbol that can be used in code?

Nov 11th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #DEFINE DEBUG
  2. ...
  3.  
  4. string returnedStr = this.SomeFoo();
  5. #if DEBUG
  6. Debug.WriteLine("returned string =" + returnedStr);
  7. #endif
  8.  
  9. define('DEBUG', true);
  10. ...
  11. if (DEBUG):
  12. $debug->writeLine("stuff");
  13. endif;
  14.  
  15. $str = 'string';
  16. DEBUG ? $debug->writeLine("stuff is ".$str) : null;
  17.  
  18. define(DEBUG, true);
  19.  
  20. [...]
  21.  
  22. if(DEBUG) echo xdump::dump($debugOut);
Add Comment
Please, Sign In to add comment