Skip to content

Backwards Compatibility

We’re strictly not breaking backwards compatibility in patch releases such as 2.x.y.Z and trying to avoid had to fix backwards incompatible changes in minor releases such as 2.x.Y.

Check Yii Versioning to learn about version numbering.

Use caseBC?
Type hint with the interfaceYes
Call the interface methodYes
Implement the interface and…
Implement methodYes
Add argument to method implementedYes
Add default value to an argumentYes
Use caseBC?
Type hint with the classYes
Create a new instanceYes
Extend the classYes
Access a public propertyYes
Call a public methodYes
Extend the class and…
Access a protected propertyYes
Call a protected methodYes
Override a public propertyYes
Override a protected propertyYes
Override a public methodYes
Override a protected methodYes
Add a new propertyNo
Add a new methodNo
Add an argument to an overridden methodYes
Add a default value to an argumentYes
Call a private method (via Reflection)No
Access a private property (via Reflection)No
Type of changeBC?
RemoveNo
Change name or namespaceNo
Add parent interfaceYes if no new methods are added
Remove parent interfaceNo
Interface methods
Add methodNo
Remove methodNo
Change nameNo
Move to parent interfaceYes
Add argument without a default valueNo
Add argument with a default valueNo
Remove argumentYes (only last ones)
Add default value to an argumentNo
Remove default value of an argumentNo
Add type hint to an argumentNo
Remove type hint of an argumentNo
Change argument typeNo
Change return typeNo
Constants
Add constantYes
Remove constantNo
Change value of a constantYes except objects that are likely to be serialized. Mandatory to document in UPGRADE.md.
Type of changeBC?
RemoveNo
Make finalNo
Make abstractNo
Change name or namespaceNo
Change parent classYes but original parent class must remain an ancestor of the class.
Add interfaceYes
Remove interfaceNo
Public Properties
Add public propertyYes
Remove public propertyNo
Reduce visibilityNo
Move to parent classYes
Protected Properties
Add protected propertyYes
Remove protected propertyNo
Reduce visibilityNo
Move to parent classYes
Private Properties
Add private propertyYes
Remove private propertyYes
Constructors
Remove constructorNo
Reduce visibility of a public constructorNo
Reduce visibility of a protected constructorNo
Move to parent classYes
Public Methods
Add public methodYes
Remove public methodNo
Change nameNo
Reduce visibilityNo
Move to parent classYes
Add argument without a default valueNo
Add argument with a default valueNo
Remove argumentsYes, only last ones
Add default value to an argumentNo
Remove default value of an argumentNo
Add type hint to an argumentNo
Remove type hint of an argumentNo
Change argument typeNo
Change return typeNo
Protected Methods
Add protected methodYes
Remove protected methodNo
Change nameNo
Reduce visibilityNo
Move to parent classYes
Add argument without a default valueNo
Add argument with a default valueNo
Remove argumentsYes, only last ones
Add default value to an argumentNo
Remove default value of an argumentNo
Add type hint to an argumentNo
Remove type hint of an argumentNo
Change argument typeNo
Change return typeNo
Private Methods
Add private methodYes
Remove private methodYes
Change nameYes
Add argument without a default valueYes
Add argument with a default valueYes
Remove argumentYes
Add default value to an argumentYes
Remove default value of an argumentYes
Add type hint to an argumentYes
Remove type hint of an argumentYes
Change argument typeYes
Change return typeYes
Static Methods
Turn non static into staticNo
Turn static into non staticNo
Constants
Add constantYes
Remove constantNo
Change value of a constantYes except objects that are likely to be serialized. Mandatory to document in UPGRADE.md.