rfc:internal_constructor_behaviour
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:internal_constructor_behaviour [2015/03/15 15:39] – Updated with list of exceptions + link to code. danack | rfc:internal_constructor_behaviour [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2015-03-01 | * Date: 2015-03-01 | ||
* Author: Dan Ackroyd, Danack@php.net | * Author: Dan Ackroyd, Danack@php.net | ||
- | * Status: | + | * Status: |
* First Published at: https:// | * First Published at: https:// | ||
Line 155: | Line 155: | ||
==== To Existing Extensions ==== | ==== To Existing Extensions ==== | ||
- | The standard of either returning a usuable | + | The standard of either returning a usable |
===== Open Issues ===== | ===== Open Issues ===== | ||
- | If anyone feels strongly about splitting the vote into separate parts, please say so. | ||
+ | Some of the Intl extension code has always had the behaviour of giving an error notice, and also throwing an exception for the same error. This behaviour should be cleaned up for the release of PHP 7, so that either an error is given, or an exception, but never both. | ||
- | ===== Proposed Voting Choices ===== | ||
- | The vote requires 2/3 to pass. | + | ===== Patches |
- | + | ||
- | Should the standard paradigm for constructors for internal objects be to return a usable instance of a class on success, | + | |
These classes will be corrected by making the constructor throw an exception rather than return null if the construction of the object fails. | These classes will be corrected by making the constructor throw an exception rather than return null if the construction of the object fails. | ||
Line 190: | Line 187: | ||
* Phar | * Phar | ||
* PharData | * PharData | ||
- | * PharFileInfo | + | |
The class PDORow will be changed to give an exception if an attempt is made to instantiate it from userland. | The class PDORow will be changed to give an exception if an attempt is made to instantiate it from userland. | ||
- | + | The changes have been made in this branch: https:// | |
- | ===== Patches and Tests ===== | + | |
- | + | ||
- | The changes have been made in this branch: https:// | + | |
The list of exceptions used are: | The list of exceptions used are: | ||
Line 215: | Line 208: | ||
ReflectionException - ReflectionExtension, | ReflectionException - ReflectionExtension, | ||
+ | |||
+ | |||
+ | ===== Voting ===== | ||
+ | |||
+ | |||
+ | Should the standard paradigm for constructors for internal objects be to return a usable instance of a class on success, and throw an exception if they encounter an error, and should the code for the classes listed below be modified to follow this standard? | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | Voting will close March 29th 2015 9pm UTC and requires 2/3 in favour to pass. | ||
===== Implementation ===== | ===== Implementation ===== | ||
After the project is implemented, | After the project is implemented, | ||
- | - the version(s) it was merged to | + | - the version(s) it was merged to: 7.0 |
- | - a link to the git commit(s) | + | - a link to the git commit(s): http:// |
- | - a link to the PHP manual entry for the feature | + | - a link to the PHP manual entry for the feature: No new manual entry, the changes are conforming to standard practice. |
rfc/internal_constructor_behaviour.1426433972.txt.gz · Last modified: 2017/09/22 13:28 (external edit)