rfc:engine_exceptions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:engine_exceptions [2013/10/24 17:34] – add section about not all errors being converted nikic | rfc:engine_exceptions [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2013-10-23 | * Date: 2013-10-23 | ||
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
- | * Status: | + | * Status: |
* Proposed for: PHP 5.6 | * Proposed for: PHP 5.6 | ||
* Patch: https:// | * Patch: https:// | ||
+ | * ML discussion: http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 10: | Line 11: | ||
This RFC proposes to allow the use of exceptions in the engine and to allow the replacement of existing fatal or recoverable fatal errors with exceptions. | This RFC proposes to allow the use of exceptions in the engine and to allow the replacement of existing fatal or recoverable fatal errors with exceptions. | ||
- | As an example of this change, consider | + | As an example of this change, consider the following code-snippet: |
<code php> | <code php> | ||
Line 123: | Line 124: | ||
<code php> | <code php> | ||
- | $lock->aquire(); | + | $lock->acquire(); |
try { | try { | ||
doSomething(); | doSomething(); | ||
Line 142: | Line 143: | ||
public function __construct(Lock $lock) { | public function __construct(Lock $lock) { | ||
$this-> | $this-> | ||
- | $this-> | + | $this-> |
} | } | ||
public function __destruct() { | public function __destruct() { | ||
Line 150: | Line 151: | ||
function test($lock) { | function test($lock) { | ||
- | $manager = new LockManager($lock); | + | $manager = new LockManager($lock); |
| | ||
doSomething(); | doSomething(); | ||
Line 308: | Line 309: | ||
==== Not all errors converted ==== | ==== Not all errors converted ==== | ||
- | PHP currently (master on 2013-10-24) contains the following number of fatal-y errors: | + | The Zend Engine |
< | < | ||
- | E_ERROR: | + | E_ERROR: |
- | E_CORE_ERROR: | + | E_CORE_ERROR: |
- | E_COMPILE_ERROR: | + | E_COMPILE_ERROR: |
E_PARSE: | E_PARSE: | ||
- | E_RECOVERABLE_ERROR: | + | E_RECOVERABLE_ERROR: |
</ | </ | ||
- | The patch attached to the RFC currently | + | The count was obtained using '' |
- | Some errors are easy to change to exceptions, others are more complicated. Some are nigh impossible, like the memory limit or execution time limit errors. The '' | + | The patch attached to the RFC currently (as of 2013-10-24) removes 70 '' |
+ | |||
+ | Some errors are easy to change to exceptions, others are more complicated. Some are impossible, like the memory limit or execution time limit errors. The '' | ||
Converting most existing errors will take some time and in the meantime we'll be in a situation where some part of the errors were converted to exceptions but another part stays fatal. From a user perspective it may not be immediately clear when one is used over the other. | Converting most existing errors will take some time and in the meantime we'll be in a situation where some part of the errors were converted to exceptions but another part stays fatal. From a user perspective it may not be immediately clear when one is used over the other. | ||
While this may be slightly inconvenient, | While this may be slightly inconvenient, | ||
+ | |||
+ | ===== Backwards compatibility ===== | ||
+ | |||
+ | The '' | ||
+ | |||
+ | The '' | ||
===== Patch ===== | ===== Patch ===== | ||
Line 331: | Line 340: | ||
The patch introduces basic infrastructure for this change and removes all '' | The patch introduces basic infrastructure for this change and removes all '' | ||
+ | |||
+ | ===== Vote ===== | ||
+ | |||
+ | This is a yes/no vote with the additional option of implementing the proposal, but without changing '' | ||
+ | |||
+ | As this is a language-related change, the vote requires a two-third majority. The 3-way vote will be interpreted as follows: If 2/3 of the total votes are for " | ||
+ | |||
+ | If you are in favor of this proposal in general, but not for PHP 5.6, use the " | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * Yes, without E_RECOVERABLE_ERROR changes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | Vote started on 2013-12-07 and ended on 2013-12-14. |
rfc/engine_exceptions.1382636050.txt.gz · Last modified: 2017/09/22 13:28 (external edit)