Re: PHP5.4 'nannying'
| From: | Richard Lynch | Date: | Mon, 19 Mar 2012 21:07:27 +0000 |
| Subject: | Re: PHP5.4 'nannying' | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-59065@lists.php.net to get a copy of this message | ||
On Sun, March 18, 2012 6:35 am, Reindl Harald wrote:
>
>
> Am 18.03.2012 10:14, schrieb Lester Caine:
>> I think what I am probably looking for is a clean guide as to how
>> code SHOULD be written nowadays in order to avoid
>> the nanny messages since it's certainly not my normal practice after
>> 10 years of coding in PHP5 ...
I once worked with a team that didn't believe in E_NOTICE...
I turned it on, and flooded the logs on a shard DEV.
I turned it off. Copied the source to my own box, ran it with
E_NOTICE, did some grep/sed/awk mumbo-jumbo to find the most common
messages, fixed those, and committed them.
And found, corrected, and closed about 5 long-standing bugs in the
process.
They started to think maybe I was on to something here... :-)
We turned E_NOTICE back on at that point, as it was only an odd script
once in a while that went to the logs. Or new code from that one guy
who still didn't quite "get" it for awhile... He came around after we
fixed a couple of his newly-introduced bugs that were triggering
E_NOTICE...
--
brain cancer update:
http://richardlynch.blogspot.com/search/label/brain%20tumor
Donate:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FS9NLTNEEKWBE