Bug #81035 [NEW]: file_get_contents emits not silenceable warning on http file not exists
| From: | shop1 at mokraemer dot de | Date: | Wed, 12 May 2021 09:46:30 +0000 |
| Subject: | Bug #81035 [NEW]: file_get_contents emits not silenceable warning on http file not exists | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-233806@lists.php.net to get a copy of this message | ||
From: shop1 at mokraemer dot de
Operating system: linux
PHP version: 8.0.6
Package: Filesystem function related
Bug Type: Bug
Bug description:file_get_contents emits not silenceable warning on http file not exists
Description:
------------
file_get_contents emits a warning instead of an exception if the file
does not exist!
This may be a good choice if the file is local where you can test for
file existence. In case of remote files via http, this is quite not
possible.
Since the silence operator does not work anymore, this raises
undesireable errors in the logs.
Test script:
---------------
file_get_contents('https://www.google.com/rss.xml');
Expected result:
----------------
do not emit warnings. Just throw exceptions!
Actual result:
--------------
the emitted warning is filling the logs and does not help!
--
Edit bug report at https://bugs.php.net/bug.php?id=81035&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81035&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81035&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81035&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81035&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81035&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81035&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81035&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81035&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81035&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81035&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81035&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81035&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81035&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81035&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81035&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81035&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81035&r=mysqlcfg