Bug #73226 [PATCH]: --r[fcez] always return zero exit code
| From: | cmb@php.net | Date: | Mon, 12 Jul 2021 21:07:24 +0000 |
| Subject: | Bug #73226 [PATCH]: --r[fcez] always return zero exit code | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234992@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73226&edit=1
ID: 73226
Patch added by: cmb@php.net
Reported by: bilge at scriptfusion dot com
Summary: --r[fcez] always return zero exit code
Status: Assigned
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: 5.6.26
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #73226: --r[fcez] always return zero exit code
On GitHub: https://github.com/php/php-src/pull/7221
Patch: https://github.com/php/php-src/pull/7221.patch
Previous Comments:
------------------------------------------------------------------------
[2016-10-02 10:37:16] bilge at scriptfusion dot com
Description:
------------
Switches --rf, --rc, --re and --rz always return a zero exit code whether the object exists or not.
However, this is in contrast to --ri, which returns zero only if the extension exists and one if it
does not.
I was not going to raise a bug until I noticed this is inconsistent, however I believe all lookups
should return non-zero if the object doesn't exist since this makes them much easier to use in
scripts to test if functionality is available.
Test script:
---------------
$ php --re foo; echo $?
Exception: Extension foo does not exist
0
$ php --re core; echo $?
<redacted>
0
$ php --ri foo; echo $?
Extension 'foo' not present.
1
$ php --ri core; echo $?
<redacted>
0
Expected result:
----------------
$ php --re foo; echo $?
Exception: Extension foo does not exist
1
$ php --re core; echo $?
<redacted>
0
$ php --ri foo; echo $?
Extension 'foo' not present.
1
$ php --ri core; echo $?
<redacted>
0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73226&edit=1