Re: [RFC][VOTE] Throwable error code's type generalization
| From: | Marco Pivetta | Date: | Fri, 06 Jan 2017 17:13:47 +0000 |
| Subject: | Re: [RFC][VOTE] Throwable error code's type generalization | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97533@lists.php.net to get a copy of this message | ||
Hi Wes,
On 6 Jan 2017 18:03, "Wes" <netmo.php@gmail.com> wrote:
Greeting fellow elePHPants and happy new year.
I've just started the vote for the RFC in subject. You can find it here:
https://wiki.php.net/rfc/throwable-code-generalization
Hope it's all fine because this is my first RFC... :P
Voting will end 13 Jan at 5 PM (UTC).
Thank you.
As previously discussed, this is a BC break that affects any consumers of
Throwable or Exception using getCode().
The fix for PDO is not "allow any garbage in the exception code", but "fix
PDO", reducing the BC break surface to a minimum.
Adding an explicit int return type check is sufficient and would get
immediate feedback from people trying new RCs.
Changing an interface (!!!!!!!) by breaking covariance is not a solution.
If you need to add more context to an exception, consider adding a new
interface that just defines an accessor for that new context information.
Greets,
Marco Pivetta