@@ -181,11 +181,34 @@ Change return type Yes [1]_ [2]_ No
181181.. [1 ] Should be avoided. When done, this change must be documented in the
182182 UGPRADE file.
183183
184- .. [2 ] The return type may only be changed to compatible types. **TODO define
185- type compatibility **
184+ .. [2 ] The return type may only be changed to compatible types. The following
185+ type changes are allowed:
186+
187+ =================== ==================================================================
188+ Original Type New Type
189+ =================== ==================================================================
190+ boolean any `scalar type `_ with equivalent `boolean values `_
191+ string any `scalar type `_ or object with equivalent `string values `_
192+ integer any `scalar type `_ with equivalent `integer values `_
193+ float any `scalar type `_ with equivalent `float values `_
194+ array instance of ``ArrayAccess ``, ``Traversable `` and ``Countable ``
195+ ``ArrayAccess `` array
196+ ``Traversable `` array
197+ ``Countable `` array
198+ =================== ==================================================================
186199
187200 .. [3 ] When changing the parent class, the original parent class must remain an
188201 ancestor of the class.
189202
190203 .. [4 ] A type hint may only be added if passing a value with a different type
191204 previously generated a fatal error.
205+
206+ .. _scalar type : http://php.net/manual/en/function.is-scalar.php
207+
208+ .. _boolean values : http://php.net/manual/en/function.boolval.php
209+
210+ .. _string values : http://www.php.net/manual/en/function.strval.php
211+
212+ .. _integer values : http://www.php.net/manual/en/function.intval.php
213+
214+ .. _float values : http://www.php.net/manual/en/function.floatval.php
0 commit comments