Re: Information about notices
From: Ron (Ron.Barnett_at_NTLWorld.nospam.com)
Date: 03/29/04
- Next message: Jon Kraft: "Re: Checking File types"
- Previous message: EbanHawk: "Checking File types"
- In reply to: Eamon Reyn: "Information about notices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 29 Mar 2004 17:13:57 +0100
"Eamon Reyn" <eamonreyn@clear.net.nz> wrote in message
news:40681c26@clear.net.nz...
> Hi Guys,
>
> I have just taken over a (student) project that is a system written using
> PHP, JavaScript MySQL, Apache, REST and a couple of other technologies.
The
> basic situation is I am the third student to work on this project and I am
> in a tidy-up/refactor phase at the moment.
>
> I was told the code was causing a lot of errors since upgrading to the
> latest version of PHP which was necessary to get REST working so I was
going
> to make my first task a bug hunt. However I think that the so called
errors
> are just notices that were displayed because the following line was in the
> php.ini file: error_reporting = E_ALL, instead of: error_reporting =
> E_ALL & ~E_NOTICE.
>
> Now I am guessing a notice is sort of like a warning you may get from the
> compiler in another programming language (ignorable but not necessarilly
> desirable and sometimes can cause problems) but was hoping some of you
good
> people might be able to explain the difference and tell me whether I
should
> be hunting these down and rewriting the code that causes them.
>
> I had a bit of a hunt through google's group search but could not find
much
> of this info if someone knows some good web links about this sort of stuff
I
> would also appreciate the info.
>
> Eamon Reyn.
Eamon,
a notice is, as you rightly guessed is more of a comment from the compiler
on your coding style rather than a real problem.
It is the sort of thing you get is when you use a variable you haven't
declared. PHP allows this but passes a comment in the form of a notice.
the manual does cover this to some extent www.php.net
Did you can set the error reporting level at any point in a script?
Personally, I keep error reporting set to E_ALL while developing and shut
off all error reporting on the live site. I try to make sure that all the
little niggles are sorted before the code goes live.
If you check the server name $_SERVER['SERVER_NAME'] you can set error
reporting accordingly for the dev server or target server at the beginning
of the script.
Unfortunately, when you inherit code it is nearly impossible to run with
E_ALL as very few people take the time to sort out every possible notice,
especially if they themselves haven't had time to complete the development.
HTH
Ron.
- Next message: Jon Kraft: "Re: Checking File types"
- Previous message: EbanHawk: "Checking File types"
- In reply to: Eamon Reyn: "Information about notices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|