Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86278 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99829 invoked from network); 16 May 2015 23:44:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2015 23:44:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.180 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.180 mail-ig0-f180.google.com Received: from [209.85.213.180] ([209.85.213.180:37750] helo=mail-ig0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/22-14891-646D7555 for ; Sat, 16 May 2015 19:44:08 -0400 Received: by igbsb11 with SMTP id sb11so23870272igb.0 for ; Sat, 16 May 2015 16:44:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lyFIkcajQm2P4/BIQcCwULM3DVEc6dghtJ5zqxhe3Hg=; b=vAs+RTPqNl4jA6bP4NznU1djbFMkc98Hz+40b1z+h7O399IiF4vv/2eeFtClNacoB+ B8X2EmtvoxKP6PwZHTd/MnVwT00qATNGCQK4io78kg2Y2pIPRjRiyhvzAmEnEEPsnklL JscVhyy20Zurq5t2Xga9KZ6/Z0UQ/fukU6j82lpa07GCWrHXuY0ZN/F0kJZOchnwWyfg WOMzzlpdqCb0kq5q4zfZrWwjPO/w+XUViliaWjHySBlXtoHREXTQv06HUbPU3l7NJd7Z ijxIVkR1M7ts/8UL1K9uUltOf6n996PET47GLn7IyMNH5PY/En0kM/mqNx96uxzUilFX qx9w== MIME-Version: 1.0 X-Received: by 10.107.10.79 with SMTP id u76mr21207850ioi.79.1431819843568; Sat, 16 May 2015 16:44:03 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.79.98.67 with HTTP; Sat, 16 May 2015 16:44:03 -0700 (PDT) In-Reply-To: <5557A5C6.5050701@gmail.com> References: <550DA4EE.2030903@php.net> <55410973.4010300@php.net> <55417C64.7000707@gmail.com> <5541B4D6.9060503@php.net> <55425D7E.6010803@gmail.com> <554D8F4D.9020903@gmail.com> <554D90CC.3040607@php.net> <5552E3EB.5010800@gmail.com> <5552E494.5070401@php.net> <5552FF58.8070807@php.net> <55575DCF.50801@gmail.com> <55578C61.3040408@gmail.com> <555796C0.2020002@gmail.com> <5557A5C6.5050701@gmail.com> Date: Sat, 16 May 2015 17:44:03 -0600 X-Google-Sender-Auth: jqO5PIazO2PZxRjKCbzNVqj9mlE Message-ID: To: Rowan Collins Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE] Exceptions in the engine From: levim@php.net (Levi Morrison) On Sat, May 16, 2015 at 2:17 PM, Rowan Collins wrote: > On 16/05/2015 20:15, Levi Morrison wrote: >> >> The difference is that as time goes on and I've written code for PHP 7 >> I was hit by this issue. It's an even bigger issue than even I >> realized during voting. How many people who voted on that issue have >> played with the code from both scenarios? Few, I can't guarantee it >> but given the historical precedent it's almost certainly true. > > > Can you give an example of the issue you were hit with? A sample program / > scenario, where failure to catch an EngineException caused behaviour that > was in some way worse than that under PHP 5? Here's a simplified example that illustrates one issue: In PHP 5 this prints "Handled.Done". Under PHP 7 this fails with: > Fatal error: Argument 1 passed to foo() must be callable, string given Note that if the TypeException had been caught by catch (Exception $e) the program would have still been correct. This kind of setup exists in PHPUnit for example; even if the test has some bad syntax or failure the testing harness needs to continue. There are other valid uses as well. The only way to make this work in both PHP 5 and 7 is to modify the code, despite the program being 100% correct under PHP 5 and the documented semantics.