rfc:make_ctor_ret_void

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
rfc:make_ctor_ret_void [2020/07/08 20:14] – updated RFC moliatarfc:make_ctor_ret_void [2020/07/22 15:29] (current) – updated RFC moliata
Line 3: Line 3:
   * Author: Benas Seliuginas, <benas.molis.iml@gmail.com>   * Author: Benas Seliuginas, <benas.molis.iml@gmail.com>
   * Target version: PHP 8.0   * Target version: PHP 8.0
-  * Status: Voting+  * Status: Declined
  
 Large credit for this RFC goes to Michael Voříšek who initially reported the bug and created a draft-- patch. Large credit for this RFC goes to Michael Voříšek who initially reported the bug and created a draft-- patch.
Line 123: Line 123:
 rule <nowiki>*forbidding*</nowiki> them from having a return specifier//". rule <nowiki>*forbidding*</nowiki> them from having a return specifier//".
  
-Another argument that is used against allowing explicit ''void'' return type is that it's going to create code-style wars and is duplicate information. But arguably, everyone also already knows what functions such as ''<nowiki>__</nowiki>toString()'' return. You know it's going to be a string. That'it'whole purpose. It would be surprising to see any code style forbidding that. Moreover, as of PHP 8.1, constructors and destructors will be the only methods that are not allowed to have a return type. This will be quite inconsistent given that ''<nowiki>__clone</nowiki>'' magic method will be able to have an explicit ''void'' return type even though both object construction and object cloning work in a similar fashion.+Another argument that is used against allowing explicit ''void'' return type is that it's going to create code-style wars and is duplicate information. But arguably, everyone also already knows what functions such as ''<nowiki>__</nowiki>toString()'' return. You know it's going to be a string. That'its whole purpose. It would be surprising to see any code style forbidding that. Moreover, as of PHP 8.0, constructors and destructors will be the only methods that are not allowed to have a return type. This will be quite inconsistent given that ''<nowiki>__clone</nowiki>'' magic method will be able to have an explicit ''void'' return type even though both object construction and object cloning work in a similar fashion.
  
 ===== Vote ===== ===== Vote =====
-Voting opened July 8th, 2020 and will close July 22nd, 2020. 
- 
 ==== Primary ==== ==== Primary ====
-<doodle title="Make constructors/destructors return void?" auth="moliata" voteType="single" closed="false">+<doodle title="Make constructors/destructors return void?" auth="moliata" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 135: Line 133:
  
 ==== Secondary ==== ==== Secondary ====
-<doodle title="Allow void return type on constructors/destructors?" auth="moliata" voteType="single" closed="false">+<doodle title="Allow void return type on constructors/destructors?" auth="moliata" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
rfc/make_ctor_ret_void.1594239253.txt.gz · Last modified: 2020/07/08 20:14 by moliata