rfc:make_ctor_ret_void
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:make_ctor_ret_void [2020/07/06 19:58] – updated RFC moliata | rfc:make_ctor_ret_void [2020/07/08 20:24] – updated RFC moliata | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Author: Benas Seliuginas, < | * Author: Benas Seliuginas, < | ||
* Target version: PHP 8.0 | * Target version: PHP 8.0 | ||
- | * Status: | + | * Status: |
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 109: | Line 109: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | ===== Why allow void return type on constructors/ | ||
+ | |||
+ | **Enforcing '' | ||
+ | |||
+ | It's key to understand that constructors and destructors in PHP don't work the same way that they do in other languages. First of all, unlike in other languages, constructors and destructors are rather normal functions in PHP and can be called directly i. e. through '' | ||
+ | |||
+ | Rowan Tommins comment on the internals mailing list should also be taken into consideration: | ||
+ | "//The way I look at it, constructors are mostly declared like a normal | ||
+ | method - they use the keyword " | ||
+ | protected, abstract, and final; and can have a parameter list, with | ||
+ | types and defaults - so the surprising thing is that there is a special | ||
+ | rule < | ||
+ | |||
+ | Another argument that is used against allowing explicit '' | ||
===== Vote ===== | ===== Vote ===== | ||
- | Primary: Make constructors | + | Voting opened July 8th, 2020 and will close July 22nd, 2020. |
+ | |||
+ | ==== Primary | ||
+ | <doodle title=" | ||
+ | | ||
+ | * No | ||
+ | </doodle> | ||
- | Secondary: Allow void return type on constructors/ | + | ==== Secondary |
+ | <doodle title=" | ||
+ | | ||
+ | * No | ||
+ | </doodle> | ||
===== Implementation ===== | ===== Implementation ===== | ||
[[https:// | [[https:// |
rfc/make_ctor_ret_void.txt · Last modified: 2020/07/22 15:29 by moliata