Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90540 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51443 invoked from network); 12 Jan 2016 10:59:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2016 10:59:49 -0000 X-Host-Fingerprint: 88.149.172.234 88-149-172-234.v4.ngi.it Received: from [88.149.172.234] ([88.149.172.234:18565] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/A2-32047-4ACD4965 for ; Tue, 12 Jan 2016 05:59:48 -0500 Message-ID: To: internals@lists.php.net Date: Tue, 12 Jan 2016 11:59:35 +0100 User-Agent: tt v. 1.0.5; www.icosaedro.it/tt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 References: <5693B6BB.9020607@gmail.com> X-Posted-By: 88.149.172.234 Subject: Re: [PHP-DEV] Throwable and Error exceptions break existing PHP 5.x code From: salsi@icosaedro.it (Umberto Salsi) giovanni@giacobbi.net (Giovanni Giacobbi) wrote: > Also think about the possible upcoming changes to the Throwable definition, > I saw in another thread that you are thinking about dropping > Throwable::getCode(), which would make things even worse, in case of > something as simple as: > set_exception_handler(function($e) { print $e->getCode(); }); Don't be afraid, Giovanni, it was only my proposal to avoid another function returning "mixed", because just this was the issue: while in PHP 5 that method is expected to return a number, under PHP 7 it may now return anything, possibly something that you cannot pass to the "print" function whitout causing another error (printing an array generates a E_NOTICE an then only displays a bare "Array"); this means that you code above not only is useless (you are printing the "code" of what?) but it is also unsafe (it may generate another error, which is not a good thing). Regards, ___ /_|_\ Umberto Salsi \/_\/ www.icosaedro.it