Bug #73226 [NEW]: --r[fcez] always return zero exit code

From: Date: Sun, 02 Oct 2016 10:37:17 +0000
Subject: Bug #73226 [NEW]: --r[fcez] always return zero exit code
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204404@lists.php.net to get a copy of this message
From: bilge at scriptfusion dot com Operating system: Linux PHP version: 5.6.26 Package: *General Issues Bug Type: Bug Bug description:--r[fcez] always return zero exit code 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 bug report at https://bugs.php.net/bug.php?id=73226&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73226&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73226&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73226&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73226&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73226&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73226&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73226&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73226&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73226&r=support Expected behavior: https://bugs.php.net/fix.php?id=73226&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73226&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73226&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73226&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73226&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73226&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73226&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73226&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73226&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73226&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73226&r=mysqlcfg

« previous php.bugs (#204404) next »