/    Sign up×
Community /Pin to ProfileBookmark

error reporting problem

Hi

My assumption is that “error_reporting(E_ALL ^E_NOTICE);” should force php to show all errors but at least in one instance I am wrong, It doesn’t display anything when a variable is not global inside a function.

I remember on my previous version of php I would see an error for this.

by the way, my question:

How can I get the most error message possible?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 02.2005 — Maybe the non-global thing generates a notice (since it is [i]not[/i] an error), and you are explicitly not displaying notices with your command?

In any case, if in PHP4 the most error-reporting would be [font=courier]error_reporting(E_ALL);[/font] while the most in PHP5 would be [font=courier]error_reporting(E_STRICT);[/font].
Copy linkTweet thisAlerts:
@NogDogSep 02.2005 — PS: I just tried it with this bit of code: and it displays an error message if I just use E_ALL, but not if I add the ^E_NOTICE.
[code=php]
error_reporting(E_ALL);
$test = 1;
function er()
{
echo $test;
}
er();
[/code]
Copy linkTweet thisAlerts:
@amahmoodauthorSep 02.2005 — Thanks NogDog

I replaced the code to yours and to my surprise it worked. I was wondering where my code came from.

After looking for the source I found out that I just copied that from php.net

[code=php] // This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE); [/code]
×

Success!

Help @amahmood spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...