rfc:inheritance_private_methods

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:inheritance_private_methods [2020/06/08 15:53]
pmmaga Close the open issues and mention exception for constructors
rfc:inheritance_private_methods [2020/07/17 14:59] (current)
pmmaga
Line 3: Line 3:
   * Date: 2020-04-16   * Date: 2020-04-16
   * Author: Pedro Magalhães, pmmaga@php.net   * Author: Pedro Magalhães, pmmaga@php.net
-  * Status: Under Discussion+  * Status: Implemented 
 +  * Target: 8.0
   * First Published at: http://wiki.php.net/rfc/inheritance_private_methods   * First Published at: http://wiki.php.net/rfc/inheritance_private_methods
  
Line 103: Line 104:
 The final keyword when applied to a private method should have no significance. In most cases, a correct approach is to use ''final protected'' modifiers in a function where overriding is not desired. The final keyword when applied to a private method should have no significance. In most cases, a correct approach is to use ''final protected'' modifiers in a function where overriding is not desired.
  
-**NOTE:** Due to how common the usage of ''final private function _construct'' is and given that the same results cannot be achieved with ''final protected function _construct'', an exception to this rule is made for constructors. With this exception, they are the only case where a child class can't override a ''final private'' method.+**NOTE:** Due to how common the usage of ''<nowiki>final private function __construct</nowiki>'' is and given that the same results cannot be achieved with ''protected'' visibility, an exception to this rule is made for constructors. With this exception, they are the only case where a child class can't override a ''final private'' method.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 123: Line 124:
 The inheritance rules for visible methods remains unaffected, including when these are static or declared on a trait. The inheritance rules for visible methods remains unaffected, including when these are static or declared on a trait.
  
-===== Proposed Voting Choices =====+===== Vote =====
  
-2/3 majority+Voting started 2020-06-15 and ends 2020-06-29. 
 + 
 +<doodle title="Remove inappropriate inheritance signature checks on private methods" auth="pmmaga" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
rfc/inheritance_private_methods.1591631639.txt.gz · Last modified: 2020/06/08 15:53 by pmmaga