On 26 October 2010 09:29, John Carter <johnc...@cisco.com> wrote: > Hi, > > When php is invoked from the command line with -h we get exit code 0 as > expected: > > -bash-3.2# php -h ; echo $? > Usage: php [options] [-f] <file> [--] [args...] > php [options] -r <code> [--] [args...] > php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] > [args...] > ... > --re <name> Show information about extension <name>. > --ri <name> Show configuration for extension <name>. > > 0 > > However if we use (what I understand to be an) invalid option we also > get 0: > > php -Z ; echo $? > Usage: php [options] [-f] <file> [--] [args...] > .... > 0 > > I've checked a couple of other tools (ls and grep) and they return exit > code 2 when the options aren't recognised. > > Found on 5.2.14 and 5.3.3. > > Thanks, > > John.
Using windows ... @ECHO OFF ECHO Calling PHP -v PHP -v ECHO %ERRORLEVEL% ECHO Calling PHP -j PHP -j ECHO %ERRORLEVEL% Both errorlevels are 0. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php