Skip to content

bug #10612 [Debug] Always ignore error_reporting value #10614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

bug #10612 [Debug] Always ignore error_reporting value #10614

wants to merge 1 commit into from

Conversation

ekaragodin
Copy link

Discussion

[Debug] Always ignore error_reporting value

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? no
Fixed tickets #10612
License MIT
Doc PR no

Debug component ignored error_reporting from php.ini.

Discussion
----------

[Debug] Always ignore error_reporting value

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #10612
| License       | MIT
| Doc PR        | no

Debug component ignored error_reporting from php.ini.
@nicolas-grekas
Copy link
Member

I'm not sure that the default php.ini settings should honored, because I'm not sure we can take for granted that they are intentionally configured the way they are.
The current behavior is to always throw by default, and this looks safe to me while in dev.
Though, if you want to be explicit (rather by implicit with ini settings), you can do:

Symfony\Component\Debug\Debug::enable(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);

@ekaragodin
Copy link
Author

Now this code does not work as expected https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Debug/ErrorHandler.php#L95
My patch fixes it.

@stof stof added the Debug label Apr 9, 2014
@fabpot
Copy link
Member

fabpot commented Apr 28, 2014

@nicolas-grekas is right. By default, we want to convert everything, but you can override the behavior as noted.

@fabpot fabpot closed this Apr 28, 2014
@ekaragodin
Copy link
Author

@fabpot then why call error_reporting in setLevel? https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Debug/ErrorHandler.php#L97

it can be replaced by

    public function setLevel($level)
    {
        $this->level = null === $level ? -1 : $level;
    }

@fabpot
Copy link
Member

fabpot commented Apr 28, 2014

The ErrorHandler class can be used by itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants