Skip to content
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

Disallow trigger_error(), which adds dangerous side-effects to PHP projects #150

Commits on Jan 10, 2020

  1. Disallow trigger_error(), which adds dangerous side-effects to PHP …

    …projects
    
    As mentioned in detail in the patch, and experienced first-hand in at least 5 real-world projects
    so far, plus numerous packages within the doctrine ecosystem itself:
    
     > Do not use runtime errors as a way to convey deprecations to users.
     > Warnings, notices, and errors in general (which aren\'t exceptions) are not usable
     > in downstream projects, and propagate to global error handlers, causing massive issues
     > in anything relying on STDOUT, STDERR, aggressive logging, or just expects decent performance
     > from a dependency. In addition to that, introducing additional runtime effects is a potential
     > BC break
    
    I don't remember when we agreed adding any `@trigger_error()` calls to the codebase, but I remember
    for sure that I stated (clearly) that `@deprecated` is my preferred way, and even with its own limitations,
    it still is much simpler to deal with downstream (and from a maintenance PoV).
    Ocramius committed Jan 10, 2020
    Configuration menu
    Copy the full SHA
    a86edaa View commit details
    Browse the repository at this point in the history