Edit report at http://bugs.php.net/bug.php?id=52496&edit=1
ID: 52496 Updated by: il...@php.net Reported by: php-bugs at thequod dot de Summary: Zero exit code on option parsing failure -Status: Open +Status: Closed Type: Bug Package: CGI related Operating System: Linux PHP Version: 5.3.3 -Assigned To: +Assigned To: iliaa Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-05-30 17:57:53] il...@php.net Automatic comment from SVN on behalf of iliaa Revision: http://svn.php.net/viewvc/?view=revision&revision=311600 Log: Fixed bug #52496 (Zero exit code on option parsing failure). ------------------------------------------------------------------------ [2010-07-30 08:36:00] php-bugs at thequod dot de Description: ------------ When PHP's option parsing fails, PHP outputs the "Usage" info, but exits with exit code 0, which means "success". So, given any PHP script where the options in the shebang line are wrong, or only considered wrong (like with bug 52495), will never execute, but always report success! Please fix this, so that option parsing will return a non-exit error code. Test script: --------------- # php --wrong-option ; echo $? Expected result: ---------------- # php --wrong-option ; echo $? Usage: php [options] [-f] <file> [--] [args...] [...] 1 Actual result: -------------- # php --wrong-option ; echo $? Usage: php [options] [-f] <file> [--] [args...] [...] 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52496&edit=1