Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Problem getting rid of PHP warning messages
Problem getting rid of PHP warning messages [message #54840] Tue, 25 September 2007 20:30 Go to next message
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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 messageGo to next message
Eclipse UserFriend
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 #56715 is a reply to message #54867] Wed, 03 October 2007 21:37 Go to previous messageGo to next message
Oliver Grätz is currently offline Oliver GrätzFriend
Messages: 1
Registered: July 2009
Junior Member
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


--
Inara: (knowing someone's around) "I suppose you heard most of that?"
Mal: (peaking around the corner at the entrance) "Only 'cause I was
eavesdropping."
[firefly 113]
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 messageGo to next message
Eclipse UserFriend
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
Eclipse UserFriend
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.
Previous Topic:Source > Shift Right/Shift Left
Next Topic:PDT debugging - MVC issues
Goto Forum:
  


Current Time: Thu Apr 25 06:00:41 GMT 2024

Powered by FUDForum. Page generated in 0.03399 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top