Re: A Review Request
| From: | Robert Cummings | Date: | Fri, 20 May 2011 13:40:23 +0000 |
| Subject: | Re: A Review Request | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312959@lists.php.net to get a copy of this message | ||
On 11-05-20 09:14 AM, Joshua Kehn wrote:
On May 20, 2011, at 4:41 AM, Tim Streater wrote:If you're going to use ugly little shortcuts why not simplify the logic?On 20 May 2011 at 04:03, Alex Nikitin<niksoft@gmail.com> wrote:but here is a brief example: (!DEBUG) || error_log("Fetch Data: ".memory_get_usage()/1048576);
DEBUG && error_log("Fetch Data: ".memory_get_usage()/1048576);
Personally I prefer the above use of an if conditional. It make it that much easier to understand what you are doing.reads and writes a lot better and faster then: if(DEBUG) { $memory = memory_get_usage()/1048576; error_log("Fetch Data: ".$memory); }
That I think is the better idea... or for the procedural types a wrapper log function that performs the DEBUG check. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.Not to me it doesn't. I find such usage incomprehensible. timI understand what you're doing, and I think it's a bad shortcut to be taking. Make a dedicated class for logging and handle all this there.