Bug #73226 [Asn->Csd]: --r[fcez] always return zero exit code

From: Date: Mon, 12 Jul 2021 21:15:14 +0000
Subject: Bug #73226 [Asn->Csd]: --r[fcez] always return zero exit code
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234994@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 Updated by: git@php.net Reported by: bilge at scriptfusion dot com Summary: --r[fcez] always return zero exit code -Status: Assigned +Status: Closed 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: Automatic comment on behalf of cmb69 Revision: https://github.com/php/php-src/commit/9db3eda2cbaa01529d807b2326be13e7b0e5e496 Log: Fix #73226: --r[fcez] always return zero exit code Previous Comments: ------------------------------------------------------------------------ [2021-07-12 21:07:24] cmb@php.net 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#234994) next »