Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85613 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99288 invoked from network); 31 Mar 2015 21:51:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2015 21:51:43 -0000 Authentication-Results: pb1.pair.com header.from=neclimdul@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=neclimdul@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.177 as permitted sender) X-PHP-List-Original-Sender: neclimdul@gmail.com X-Host-Fingerprint: 209.85.192.177 mail-pd0-f177.google.com Received: from [209.85.192.177] ([209.85.192.177:33674] helo=mail-pd0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/62-19757-FE61B155 for ; Tue, 31 Mar 2015 16:51:43 -0500 Received: by pdrw1 with SMTP id w1so25157231pdr.0 for ; Tue, 31 Mar 2015 14:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=j7krVHOwjiV/qaYn/QtNq19sdK0eM5pR/CG2+xJ5ejY=; b=wzIxvZwJV23jmDNynAxOR94JP7jUaHaUBvZFsP4Rt/paELrh9R/kUALQ5l4LTKX3MD acCywMzwiev9mKqLP8ZNFFslOp/gvwVjazYq73h4kyXTWzWKs8Rj/EZGqZaxpUiK791M X3CuaF//RwdUnSPGZiBqLzMBVnlcLGSx1JX37XBzAghzHB/BXCXBwHehFF/f1XljKnEN jjrB1cy/8+Xxngo3eGfaIRR0B7Z3SFC5DkXkUGoejuUC/euFRL26URkn7+tU1lS4ro2V +9QhF7wwszhqzWVxXACqz7ZlblXyyh0o3DgDPmaPjO6+uijQZs1Gnck1hhavpS3+kFQl xSLw== MIME-Version: 1.0 X-Received: by 10.66.182.201 with SMTP id eg9mr30433118pac.68.1427838700226; Tue, 31 Mar 2015 14:51:40 -0700 (PDT) Received: by 10.70.131.3 with HTTP; Tue, 31 Mar 2015 14:51:40 -0700 (PDT) Date: Tue, 31 Mar 2015 16:51:40 -0500 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7bd6c3b486106e05129c9ae6 Subject: Backwards compatibility with set_exception_handler callback and type hints From: neclimdul@gmail.com (James Gilliland) --047d7bd6c3b486106e05129c9ae6 Content-Type: text/plain; charset=UTF-8 So testing out PHP 7 I triggered an \EngineException() in Drupal 8. For various reasons that don't really matter here Drupal uses set_exception_handler() to provide its own exception handler. What is important is that the methods used by that handler type hint \Exception for their arguments. The immediately fatals. By design, \EngineException does not extend \Exception so code doesn't accidentally catch this special type of exception. Unfortunately they still always make their way into this exception handler. Unfortunately this means we have to remove the type hinting to support forward compatibility which is a bit akward and unfortunate. I don't know if this is all acceptable and/or by design but it is awkward so I wanted to bring it to the list to discuss. Simplified test case. Sorry for not putting it on 3v4l but its currently unreachable. https://gist.github.com/neclimdul/ab29ddb223cfc197e635 --047d7bd6c3b486106e05129c9ae6--