Re: [RFC] Throwable Interface

From: Date: Wed, 10 Jun 2015 01:19:48 +0000
Subject: Re: [RFC] Throwable Interface
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-86533@lists.php.net to get a copy of this message
Hi all, On Tue, May 26, 2015 at 3:02 AM, Rowan Collins <rowan.collins@gmail.com> wrote: > On 24/05/2015 22:32, Yasuo Ohgaki wrote: > >> Does this include internal function type errors? >> e.g. >> >> $ php -r 'var_dump(mt_srand("99999999999999999999999999999999999"));' >> PHP Warning: mt_srand() expects parameter 1 to be integer, string given >> in >> Command line code on line 1 >> NULL >> >> If not, please make these exceptions rather than E_WARNING. >> We need consistency here. >> > > Changing a Warning to an Exception is a much bigger deal than changing an > Error to an Exception. While an Exception *can* be caught, the fundamental > nature of it is that it is *fatal* if it is not caught. So you would be > changing an advisory warning to a fatal error. > > There might be cases where this would be sensible, but this has nothing to > do with a) changing Errors to Exceptions (which has already passed) or b) > changing the hierarchy to add a Throwable interface (the subject of this > thread). Error and unhandled exception differs a lot. I agree. Personally, I don't mind at all if internal function raises exception for type errors, but others may be disturbed a lot probably. We need a roadmap to clean this mess up. How about add - Change internal function type error to exception by PHP 7.1 (or PHP 7.2 if a year is not enough) to the RFC for smoother migration and future consistency? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#86533) next »