Problem getting rid of PHP warning messages [message #54840] |
Tue, 25 September 2007 20:30 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: terpz99-gp.yahoo.com
Hi there. PHP and PDT newbie here.
I am trying to develop a simple PHP script but cannot get rid of warning
(i.e. E_WARNING) messages from my script when I perform a debug with PHP
5.0.5.
I am using the "Debug as PHP Script" option. I have already set
error_reporting(E_ERROR) in index.php yet the warning message still appears.
A sample output of my script (index.php) is as follows:
Debug Strict (PHP 5): index.php line 12 - var: Deprecated. Please use
the public/private/protected modifiers
Any ideas?
|
|
|
Re: Problem getting rid of PHP warning messages [message #54867 is a reply to message #54840] |
Tue, 25 September 2007 22:05 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: Martin.eisengardt.de
> I am trying to develop a simple PHP script but cannot get rid of warning
> (i.e. E_WARNING) messages from my script when I perform a debug with PHP
> 5.0.5.
Seems to be an old version :-)
>
> I am using the "Debug as PHP Script" option. I have already set
> error_reporting(E_ERROR) in index.php yet the warning message still
> appears.
Developers should not ignore any warning but should resolve this problem.
Bad idea trying to ignore any warning.
> Debug Strict (PHP 5): index.php line 12 - var: Deprecated. Please use the
> public/private/protected modifiers
RTFM or simply read this warning as it says everything :-)
PHP5: http://de3.php.net/manual/en/language.oop5.basic.php
Example 19.2 (member variable decleration) vs
PHP4: http://de3.php.net/manual/en/language.oop.php
First example.
|
|
|
Re: Problem getting rid of PHP warning messages [message #55756 is a reply to message #54867] |
Thu, 27 September 2007 17:58 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: terpz99-gp.yahoo.com
Martin Eisengardt wrote:
>> I am trying to develop a simple PHP script but cannot get rid of warning
>> (i.e. E_WARNING) messages from my script when I perform a debug with PHP
>> 5.0.5.
> Seems to be an old version :-)
>
>> I am using the "Debug as PHP Script" option. I have already set
>> error_reporting(E_ERROR) in index.php yet the warning message still
>> appears.
> Developers should not ignore any warning but should resolve this problem.
> Bad idea trying to ignore any warning.
>
>> Debug Strict (PHP 5): index.php line 12 - var: Deprecated. Please use the
>> public/private/protected modifiers
> RTFM or simply read this warning as it says everything :-)
> PHP5: http://de3.php.net/manual/en/language.oop5.basic.php
> Example 19.2 (member variable decleration) vs
> PHP4: http://de3.php.net/manual/en/language.oop.php
> First example.
>
>
Thanks for the links! I have since upgraded to PDT 1.0 and PHP 5.2.3.
However, I am still unable to customize the error messages in the
"Console" view of PDT although I have tried different versions of PHP's
error_reporting() function [e.g. error_reporting(E_CORE)) ].
For example, there seems to be no way to turn off NOTICE level messages
generated by PHP. Here's what I get when echo an undefined variable.
Notice: test.php line 58 - Undefined variable: undefined_variable
PS: I need to customize the level of error messages displayed in the
console because I'm already using a debugger and would want to isolate
problems more specifically using customized error levels.
|
|
|
|
Re: Problem getting rid of PHP warning messages [message #56743 is a reply to message #56715] |
Wed, 03 October 2007 22:36 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: dkel50.hotnospmail.com
Do you get this problem if you run the script, rather than debug it ?
how about running it outside of PDT ?
Maybe you could find a php newsgroup to ask about it as there might be
someone with knoweldge of the internals of PHP who could help.
Dave Kelsey
Oliver Grätz wrote:
> Martin Eisengardt schrieb:
>>> I am trying to develop a simple PHP script but cannot get rid of warning
>>> (i.e. E_WARNING) messages from my script when I perform a debug with PHP
>>> 5.0.5.
>> Seems to be an old version :-)
>>
>>> I am using the "Debug as PHP Script" option. I have already set
>>> error_reporting(E_ERROR) in index.php yet the warning message still
>>> appears.
>> Developers should not ignore any warning but should resolve this problem.
>> Bad idea trying to ignore any warning.
>>
>>> Debug Strict (PHP 5): index.php line 12 - var: Deprecated. Please use the
>>> public/private/protected modifiers
>> RTFM or simply read this warning as it says everything :-)
>> PHP5: http://de3.php.net/manual/en/language.oop5.basic.php
>> Example 19.2 (member variable decleration) vs
>> PHP4: http://de3.php.net/manual/en/language.oop.php
>> First example.
>
> 1. Whether 5.0.5 is old or not is out of scope here. Some people have no
> choice which version to use.
>
> 2. Suppressing messages is part of the deployment process. First of all
> one does NOT want those messages popping up on the production server.
> And then, sometimes it is NOT the code written by the programmer that
> throws warnings but some big collection of foreign that is just used and
> not part of the own development process.
>
> 3. The deprecation of "var" has been removed in a version after 5.0.5 (I
> don't recall exactly when). It is now a synonym for "public".
>
> 4. How about answering the question instead of shooting torpedoes at the
> persion asking the question?
>
> As for the problem, perhaps the error reporting is reset at another
> place in the application. Try to check its value directly before the
> line where a warning is generated. If the level is set in a config file:
> Double-check that you are editing the correct configuration file!
>
> OLLi
>
>
|
|
|
Re: Problem getting rid of PHP warning messages [message #57090 is a reply to message #56715] |
Fri, 05 October 2007 15:28 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: Martin.eisengardt.de
> 1. Whether 5.0.5 is old or not is out of scope here. Some people have no
> choice which version to use.
Some simple hint that updating might help. Next time You should have a look
at emoticons. This emoticon might imply some special meaning...
>
> 2. Suppressing messages is part of the deployment process. First of all
> one does NOT want those messages popping up on the production server.
> And then, sometimes it is NOT the code written by the programmer that
> throws warnings but some big collection of foreign that is just used and
> not part of the own development process.
It's not up to me to decide this. You are not able to suppress this warning
at this php version as the author said (since there were some bugs with
E_STRICT in early 5.0 versions, might be fixed in 5.0.5 already...). One
might shutting off "display errors". But they still will be posted in logs.
Where is the problem?
But... "Suppressing messages is part of the deployment process.". OK, I am a
professional software developer but I am a Hobbyist too. I do not recommend
to simply ignore/ suppress warnings but to understand and solve them. We do
have different opinions on this but every developer should produce some
clean code and should not imply that productional machines are running with
E_ERROR.
Author said " am trying to develop a simple PHP script but cannot get rid of
warning ". For me it does not imply this problem resides in some third party
scripts. I decided to explain this problem (link php manual) and not to
simply tell him how to shut it off.
>
> 3. The deprecation of "var" has been removed in a version after 5.0.5 (I
> don't recall exactly when). It is now a synonym for "public".
5.1.3
But it will be removed in some future version (perhaps 6). Look at php's
mailing lists.
|
|
|
Powered by
FUDForum. Page generated in 0.04042 seconds