Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93995 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8280 invoked from network); 15 Jun 2016 10:28:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2016 10:28:01 -0000 Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-lf0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:34139] helo=mail-lf0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/EB-27860-FAD21675 for ; Wed, 15 Jun 2016 06:28:00 -0400 Received: by mail-lf0-f45.google.com with SMTP id j7so9532378lfg.1 for ; Wed, 15 Jun 2016 03:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=WBGpl3Q7lZss1VcMm3+wT1gBmUTjDluPmtp7DcPw9UI=; b=Oftr8fz/BOZAcG+B6zRqMxyylIUCIroeGMbivaG6NjR8flfql/vmssTL4A8zj36xbh 1VA3lbBqrOYE83LtkwWkv9VGegVCTWQV1J6PYPGA2y0XFjDRaufYuVzE7mNowgac1y/s iBUFKmqNXQn2PwanOlDOHUk0p84l8HqeLj27W5Xg4qNQa9KplNEY+jj8YfPyB1+uzzIl RWQ9z82RYbGrI4pqXyvZSiZXQtPuymjNEpZk1EwoTJmEwbqH6mZsox95tC+bGAKF+SP1 SCOqM+MghW+u3/KyxR6ocnhlKqbWQaWvIwMPMnmeHNo7yzBbZqxH0lBk3IcZ0qkx2ZJ+ btjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=WBGpl3Q7lZss1VcMm3+wT1gBmUTjDluPmtp7DcPw9UI=; b=UV4YadHg3Gmd3w7wq3j9tKZeJ1nAOVMtk5sHXaV0I/y9gRuXiFgpnLkhOz/XlQnM59 YQrutyKJ5eSBCFMfti/eiEgwCJ5dmM0oXVOJBFf2+Wo7ro+eNiyGHNZ7IvdXJ/WLeQjM sbwfI+2Ofo//lg79ZqNcsqc6rDXxEehZHqGs8SqnNWsYFRWXK/mBvnLKah9xLP9vSgFU mO6I1nqRaBJg9BdriTVSfEqBtGQMC3JUWx5i0MFFyP0RH3l/uKgmIoxRnEc3Lsj6sate oCP7lIELgiLCIGpbIxk70Si9Z8xVKgI2pcMlQzfbY1Zfp1qWqXHvBzcOUQuZq4VzOhtO u4jA== X-Gm-Message-State: ALyK8tKgFJL7Uzlex3KIPOAuwe1MkHXLwnj9quhy1r+VQ1odABwhjaSaSucKKtTAmuzUvtkUCm+yxGqE7dO/wg== X-Received: by 10.25.30.194 with SMTP id e185mr3590616lfe.202.1465986476887; Wed, 15 Jun 2016 03:27:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.136.6 with HTTP; Wed, 15 Jun 2016 03:27:56 -0700 (PDT) Date: Wed, 15 Jun 2016 13:27:56 +0300 Message-ID: To: PHP internals list Content-Type: multipart/alternative; boundary=001a11403be033560605354e9324 Subject: Throwing an Error for require expressions in PHP7.x From: lisachenko.it@gmail.com (Alexander Lisachenko) --001a11403be033560605354e9324 Content-Type: text/plain; charset=UTF-8 Hi, internals! For PHP7 we have pretty errors for almost everything, even eval can throw a ParseError exception, but not for the require expression, because it's still producing an uncatchable fatal errors: try { require('no.php'); } catch (Throwable $e) { echo 'Catch!'; } finally { echo 'Finally?'; } // Warning: require(no.php): failed to open stream: No such file or directory // Fatal error: require(): Failed opening required 'no.php' See https://3v4l.org/sQeAQ for live demo. What are the reasons not to throw Error here? Looks like an oversight for me. Can we also add FileNotFoundException and use it for all file functions to avoid silencing with "@" operator? Then require expression can throw an Error with nested FileNotFoundException. Thoughts? --001a11403be033560605354e9324--