Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:93999 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15188 invoked from network); 15 Jun 2016 10:51:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jun 2016 10:51:57 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:56246] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/4D-27860-A4331675 for ; Wed, 15 Jun 2016 06:51:56 -0400 Received: from [192.168.2.102] ([217.82.228.97]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MUpI8-1auSxV2g7o-00YCNX; Wed, 15 Jun 2016 12:51:49 +0200 To: Alexander Lisachenko , PHP internals list References: Message-ID: <2f5d1f3b-c6db-fe83-e821-8e0d8bba603e@gmx.de> Date: Wed, 15 Jun 2016 12:52:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:70/MrrhkFREWykzjMuCjWEeb3jq9CPMi6OK/p9ccXKYhM1ebGYD fGcGb9uk754kGyj7+V9ISZAJHuYCrGNQxz+RCc/xcr/OA/MPBuO1t2snPn9l82kUIw2++BW q8DCrP8QK4A7axZejnvGMjG0kS4cb1D6z7+ckGJboMq7e8XmMu18IfEVX8jyoFvrdIArc27 Rb/LwvKgrPUp07NNl9DcQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:wD8QTFi/MN0=:rW6h1ttIsIWJ7CDxQxEFWw e/XIkEegg4pERYEYzfcO/msJ4lB8Ny+CCN5spEyqlr5AbUKXRHXLJAkm/q4KEsRNCb29PMUWN bsodE8fitoeHCdQuYlm3M8ZXxT4UERZsfVTIrO8eiw/yt5m3PHuhAVV3iRpYWy/extlyLL1R9 kqPgSWvKxSELZiItuhjI29xzR4Bz2pcV7wDkFt5TD7aNb0/jA8V6yuvRY5xNtcK9Rfp5l+Cej +tSfSG2PqtYWhuspQXWJZ8XwxLPNWAwB4kpbFq0S+X+xgjpZxLwDNupimcUnAQh2LcY3PZt3O hWUIMS+PRt0+UCuMqjjWjnF9WXKpiS07Zom3V5PR/B/FdEUPUCBX3Hc6HObsI2QPnXgv7O0z9 QaNhV8UznFvEQGC3S3zWQ7n6Euxvno6o8znzVgOkUqm0WulDtYvWTlCB4ZLYiZmXWy3ChMdPM 2GTFz9yh24Kifz7dzSu701oU33usd3H5PGWPqCVszMKKS764Et0EgzW3t54gMFgw05sd6kK2M 99I+t1+FcrE9RdzYJcrLUL8veYjFtsGuhrsHy7oxkdKOM9kiPPEajLFvglgapCXK+SRnNy4P/ 38wZFqFrAcpuybMEY6BKVISm1RppGiGwYjTY9adYKGam3qPfwMQUPT9Ppa5g2ph4b+ci8qJNh JI0PHAg7rOddrIeCtCQ5wxKsptI4QK61R2FUhKdWGztCaz4sAABon+pQ74Agev8Q4qz3tjCr/ 2sMqHJm3rl95mvveBTo8cKltjnmdZ4SZNs1ofksAyzEHbz4OcruvpPwCWGD8CMBxl/SvuqXah NJQMIC/ Subject: Re: Throwing an Error for require expressions in PHP7.x From: cmbecker69@gmx.de (Christoph Becker) On 15.06.2016 at 12:27, Alexander Lisachenko wrote: > 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. This had recently been reported as feature request, and my reply was: | With regard to your example: if a file is *required* and it can't | be included, it doesn't make much sense to go on. If on the other | hand the file is not really required, just `include` it. [1] -- Christoph M. Becker