rfc:constructor_return_type

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:constructor_return_type [2020/06/14 19:41] – updated RFC moliatarfc:constructor_return_type [2020/06/16 21:14] – deleted RFC moliata
Line 1: Line 1:
-====== PHP RFC: Allow void return type on constructors/destructors ====== 
-  * Date: 2020-06-14 
-  * Author: Benas Seliuginas, <benas.molis.iml@gmail.com> 
-  * Status: Draft 
-  * Target version: PHP 8.0 
  
-===== Introduction ===== 
-RFC proposes to allow using ''void'' return type on constructors and destructors (e. g. for alternative code style, consistency with other methods, etc.). In a way, this RFC is like a trailing comma: some might use it, some might not, but both cases are valid and allowed. 
- 
-===== Proposal ===== 
- 
-===== Backward Incompatible Changes ===== 
-None. 
- 
-To ensure backwards compatibility, it is allowed to not specify a return type at all. Although, since no return type is ''mixed|void'', it is not allowed to narrow the return type to ''mixed'', only ''void''. 
- 
-===== Vote ===== 
-2/3 majority Yes/No. 
- 
-===== Implementation ===== 
-[[https://github.com/php/php-src/pull/5717|GitHub Pull Request]] 
rfc/constructor_return_type.txt · Last modified: 2020/06/17 10:04 by cmb