[FX.php List] PHP Notices OK?
Jonathan Schwartz
jschwartz at exit445.com
Wed Dec 12 12:08:58 MST 2007
Folks,
Thanks for all your valuable perspective.
I'd like to kick this discussion up a notch,
hopefully for the benefit of the fx.php community.
Since joining this list, I've been learning
lessons from fellow fx.php members (thank you)
about fundamentals one at a time as a problem is
encountered. The order and completeness of
gaining knowledge seems to be determined by the
circumstance of a given task or project.
Is anyone up for starting a Best Practices
List/Guide/Do's and Don't List/etc to help
establish the standards and practices that we
should be at least aware of , if not following?
For example, in the case of this current thread
about Notices, I would have been practicing
better coding earlier if I recognized that this
was a fundamental .
I realize that something like this sounds
daunting and *could* get out of control, but I'm
willing to start it...with Chris' OK, of course.
Is anyone else interested?
Regards,
Jonathan
At 5:45 PM +0000 12/12/07, Steve Winter wrote:
>Jonathan,
>
>As you know time is money, if the money he paid justifies the time, then
>perhaps it would be best to say 'hey, I'll fix it'... if not, and he wasn't
>kicking and screaming about having to change his php.ini file, then perhaps
>'let sleeping dogs lie' (I'm full of little clichés today aren't I ;-)
>
>For future projects, make sure notices are turned on on your testing server,
>then you can work through them as you go... pretty soon you'll come to know
>instinctively what will cause them, and the method to use to prevent them
>from occurring and it'll take no more time than if you just let it be...
>
>Inflation has struck, that little gem's worth 2 Yuan...
>
>Cheers
>Steve
>
>
>
>-----Original Message-----
>From: fx.php_list-bounces at mail.iviking.org
>[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jonathan Schwartz
>Sent: 12 December 2007 17:38
>To: Roger Price; FX.php Discussion List
>Subject: Re: [FX.php List] PHP Notices OK?
>
>Roger,
>
>Thanks for the perspective.
>
>Here's why I am asking the question today. I just provided a modest
>solution to a third party, instructing him to turn off Notices to
>stop the reporting. I'm just trying to figure out if making that
>request is a reasonable and/or professional request or, it's like
>turning the lights down real low in a restaurant with dirty
>silverware. ;-)
>
>If there is any question, I will take the code back and work thru the
>error corrections.
>
>So what's the vote tally now? Only ggt says its OK?
>
>
>Jonathan
>
>
>
>At 5:07 PM +0000 12/12/07, Roger Price wrote:
>>Jonathan
>>
>>I fell 'foul' of undefined variable notices a few weeks ago when I
>>was given a right earhole bashing by my University hostmaster.
>>
>>PHP takes these in its stride but the reporting feature was switched
>>on. I use many include files (some nested and on evey page), so
>>adding another include file called 'define.php', which check every
>>variable that appears in the log and if undefined sets it to zero or
>>null - whatever is appropriate. This does not appear to degrade the
>>performance of the pages too much and keeps the hostmaster happy.
>>However given the choice I would just turn 'notices' off but that is
>>not an option for me!
>>
>>Roger
>>
>>
>>----- Original Message ----- From: "Jonathan Schwartz"
><jschwartz at exit445.com>
>>To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
>>Sent: Wednesday, December 12, 2007 4:39 PM
>>Subject: RE: [FX.php List] PHP Notices OK?
>>
>>>OK. That's fair.
>>>
>>>To be honest, I never knew about these things since I have
>>>developed on my own server and Notices are turned off....until now.
>>>;-)
>>>
>>>One step further...my notices appear to be of the Undefined
>>>Variable type. I did see your suggestion from last week, to add in
>>>if(isset($variable)) rather than "surprise" PHP when an undeclared
>>>variable appears. Is another alternative to simply declare the
>>>variable at the top of he page? If so, how is that best done?
>>>
>>>Thx
> >>
>>>Jonathan
>>>
>>>At 4:15 PM +0000 12/12/07, Steve Winter wrote:
>>>>Hi Jonathan,
>>>>
>>>>Well I guess that one is rather 'up to the conscience of the individual
>>>>church goer' ;-)
>>>>
>>>>For me, personally, no, it's not acceptable, as it means that something
> >>>isn't 100% correct, which means you can't be 100% sure that when it runs
>on
>>>>a client server, or you move it from one server to another, that it will
>>>>still behave correctly...
>>>>
>>>>My staging server has every level of error reporting possible turned on,
>and
>>>>when that gives no messages, notices, errors, or unexpected twitches,
>then I
>>>>feel reasonably sure that my code will run at the very least, on similar
>>>>versions of PHP, if not on all...
>>>>
>>>>My 2p worth...
>>>>
>>>>Cheers
>>>>Steve
>>>>
>>>>-----Original Message-----
>>>>From: fx.php_list-bounces at mail.iviking.org
>>>>[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jonathan
>Schwartz
>>>>Sent: 12 December 2007 16:05
>>>>To: FX.php Discussion List
>>>>Subject: [FX.php List] PHP Notices OK?
>>>>
>>>>Hi Folks,
>>>>
>>>>Is it acceptable for a solution to produce NOTICES (for undefined
>>>>variables) and then essentially hide them by turning off
>>>>error_reporting NOTICES?
>>>>
>>>>Or at minimum, should the solution run clean without notices?
>>>>
>>>>
>>>>Thx
>>>>--
>>>>Jonathan Schwartz
>>>>Exit 445 Group
>>>>jonathan at exit445.com
>>>>http://www.exit445.com
>>>>415-381-1852
>>>>_______________________________________________
>>>>FX.php_List mailing list
>>>>FX.php_List at mail.iviking.org
>>>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>>
>>>>_______________________________________________
>>>>FX.php_List mailing list
>>>>FX.php_List at mail.iviking.org
>>>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>>
>>>--
>>>Jonathan Schwartz
>>>Exit 445 Group
>>>jonathan at exit445.com
>>>http://www.exit445.com
>>>415-381-1852
>>>_______________________________________________
>>>FX.php_List mailing list
>>>FX.php_List at mail.iviking.org
>>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>>
>>
>>_______________________________________________
>>FX.php_List mailing list
>>FX.php_List at mail.iviking.org
>>http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>--
>Jonathan Schwartz
>Exit 445 Group
>jonathan at exit445.com
>http://www.exit445.com
>415-381-1852
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list
--
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-381-1852
More information about the FX.php_List
mailing list