rfc:tostring_exceptions
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:tostring_exceptions [2019/04/30 13:14] – typo nikic | rfc:tostring_exceptions [2019/05/22 16:46] – Fix typo sebastian | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2019-04-30 | * Date: 2019-04-30 | ||
* Author: Nikita Popov < | * Author: Nikita Popov < | ||
- | * Status: | + | * Status: |
* Target Version: PHP 7.4 | * Target Version: PHP 7.4 | ||
* Implementation: | * Implementation: | ||
Line 9: | Line 9: | ||
Throwing exceptions from '' | Throwing exceptions from '' | ||
- | This makes it dangerous to call arbirary | + | This makes it dangerous to call arbitrary |
general API problematic. This RFC aims to remove this restriction. | general API problematic. This RFC aims to remove this restriction. | ||
The rationale for the current behavior is that string conversions are performed in many places | The rationale for the current behavior is that string conversions are performed in many places | ||
- | through | + | throughout |
" | " | ||
This limitation is ultimately futile from a technical perspective, | This limitation is ultimately futile from a technical perspective, | ||
- | string conversion can still be triggered by error handler that convert warnings | + | string conversion can still be triggered by an error handler that converts recoverable errors |
<PHP> | <PHP> | ||
Line 31: | Line 31: | ||
</ | </ | ||
- | However, the sentiment in past discussions on this topic has been to not relax this restriction | + | In fact, Symfony [[https:// |
- | until we have performed a more comprehensive audit of string conversions across the codebase. This | + | |
- | has been done in the attached implementation pull request. | + | Despite this, the sentiment in past discussions on this topic has been to not relax this restriction |
+ | until we have performed a comprehensive audit of string conversions across the codebase. This | ||
+ | has been done in the attached implementation | ||
===== Proposal ===== | ===== Proposal ===== | ||
Line 81: | Line 83: | ||
- | // Like convert_to_string() but returns a boolean | + | // Like convert_to_string() but returns a boolean |
if (!try_convert_to_string(val)) { | if (!try_convert_to_string(val)) { | ||
// Possibly free other resources here. | // Possibly free other resources here. | ||
Line 97: | Line 99: | ||
===== Vote ===== | ===== Vote ===== | ||
- | Allow exceptions from '' | + | Voting started 2019-05-22 and ends 2019-06-05. |
+ | |||
+ | <doodle title=" | ||
+ | | ||
+ | | ||
+ | </ | ||
rfc/tostring_exceptions.txt · Last modified: 2019/06/14 12:12 by theodorejb