Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Question: Why is E_USER_DEPRECATED used in stead of E_DEPRECATED? #98

Closed
Rud5G opened this issue Mar 9, 2016 · 3 comments
Closed

Question: Why is E_USER_DEPRECATED used in stead of E_DEPRECATED? #98

Rud5G opened this issue Mar 9, 2016 · 3 comments
Labels

Comments

@Rud5G
Copy link

Rud5G commented Mar 9, 2016

In my production php.ini the error_reporting settings are:

; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

This does not filter the E_USER_DEPRECATED triggered in https://github.com/zendframework/zend-mvc/blob/master/src/Service/ServiceManagerConfig.php#L127

@Rud5G
Copy link
Author

Rud5G commented Mar 9, 2016

Maybe i should have added this to #88

@weierophinney
Copy link
Member

Because E_DEPRECATED can only be triggered by PHP itself, to indicate deprecated functionality in the PHP engine itself. For userland code (including frameworks and libraries!) to trigger deprecation notices, you must use E_USER_DEPRECATED.

BTW, you can add that to the error_reporting mask, too:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_USER_DEPRECATED

@Rud5G
Copy link
Author

Rud5G commented Mar 9, 2016

Thanks!, just wanted to be sure.

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

No branches or pull requests

2 participants