Bug #79691 [Nab]: Lack of error checking in `posix_kill`
| From: | nikic@php.net | Date: | Fri, 12 Jun 2020 07:29:23 +0000 |
| Subject: | Bug #79691 [Nab]: Lack of error checking in `posix_kill` | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227441@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79691&edit=1
ID: 79691
Updated by: nikic@php.net
Reported by: srivas41 at purdue dot edu
Summary: Lack of error checking in
posix_kill
Status: Not a bug
Type: Bug
Package: POSIX related
Operating System: Ubuntu 16.04
PHP Version: 7.4.7
Block user comment: N
Private report: N
New Comment:
Undefined variables were changed from E_NOTICE to E_WARNING in PHP 8.0. Additionally, E_ALL is now
used as the default error reporting level.
Unfortunately elevating undefined variables to an exception did not reach consensus. Apparently some
legacy code intentionally uses undefined variables.
Previous Comments:
------------------------------------------------------------------------
[2020-06-12 00:48:03] requinix@php.net
E_ERROR is fatal and E_COMPILE_ERROR is for compilation errors.
E_WARNING is appropriate.
Use an IDE that can identify these sorts of problems for you, and always make sure that errors are
being logged or outputted to somewhere you can monitor.
------------------------------------------------------------------------
[2020-06-11 23:54:28] srivas41 at purdue dot edu
Okay, it does emit an warning with the php.ini configurations you specified. Currently,
this warning is emitted at E_ALL. Do you think it would be better if it was flagged as
an error such as E_ERROR or E_COMPILE_ERROR instead? Since in in this
particular case the variable being undefined can have unintended side-effects.
------------------------------------------------------------------------
[2020-06-11 23:25:03] requinix@php.net
Mind the typo.
------------------------------------------------------------------------
[2020-06-11 23:24:45] requinix@php.net
They're php.ini settings.
display_errors = on
error_reporting = =-1
https://www.php.net/manual/en/errorfunc.configuration.php
------------------------------------------------------------------------
[2020-06-11 23:20:04] srivas41 at purdue dot edu
Could you specify which set of configuration flags enables PHP to warn about the undefined variable
in this specific case? I built with ./buildconf && ./configure --enable-werror
&& make -jnproc`. No error or warning was emitted while running the test script.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79691
--
Edit this bug report at https://bugs.php.net/bug.php?id=79691&edit=1