Inconsistent exit code from CLI?

From: Date: Tue, 26 Oct 2010 08:29:17 +0000
Subject: Inconsistent exit code from CLI?
Groups: php.internals 
Request: Send a blank email to internals+get-49971@lists.php.net to get a copy of this message
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. -- John Carter Development Manager johncart@cisco.com

« previous php.internals (#49971) next »