Skip to content

Instantly share code, notes, and snippets.

@morrisonlevi
Last active November 21, 2016 16:20
Show Gist options
  • Save morrisonlevi/b848ec29fb5697798f4b553a97f90f74 to your computer and use it in GitHub Desktop.
Save morrisonlevi/b848ec29fb5697798f4b553a97f90f74 to your computer and use it in GitHub Desktop.
PHP: What is a backwards compatibility break?

This is the basis for what I think a backwards compatibility break should be defined as and where they are appropriate.

Generally any change which will alter the previous behavior in any way is considered a backwards compatibility break. All backwards compatibility breaks must be voted on as per whatever the current voting rules are.

There are acceptable backwards compatibility breaks for minor releases (again, assuming they pass the vote):

  • Emitting new warnings, notices, and deprecations
  • Elevating a previous warning, notice or deprecation to be more strict (but not to an exception)
  • Adding a concrete method, property or constant to an existing class or trait
    • Adding an abstract method is not acceptable
  • Adding a constant to an existing interface
    • Adding a new method to an interface is not acceptable
  • Adding keywords, functions, classes, constants, etc that were previously "soft" reserved, meaning they were described as reserved on PHP.net but had no enforcement in the engine

Any backwards compatibility break is an option for major versions; the only requirement is that it passes vote.

Backwards compatibility breaks are not allowed in patch versions except for security issues, regressions and/or major bugs. Perhaps a definition of "major bug" is in order as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment