Bug #17734: CLI and CGI sapi return error code '0' (success) if file couldn't be parsed
| From: | mfischer@php.net | Date: | Thu, 13 Jun 2002 02:09:55 +0000 |
| Subject: | Bug #17734: CLI and CGI sapi return error code '0' (success) if file couldn't be parsed | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-10298@lists.php.net to get a copy of this message | ||
From: mfischer@php.net
Operating system: Any
PHP version: 4.0CVS-2002-06-12
PHP Bug Type: *General Issues
Bug description: CLI and CGI sapi return error code '0' (success) if file couldn't
be parsed
$ cat test.php
<?
happy_parser_error(
?>
$ php -v
PHP 4.3.0-dev (cli), Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.2.1, Copyright (c) 1998-2002 Zend Technologies
$ php -f test.php ; echo $?
Parse error: parse error, unexpected ';', expecting ')' in test.php on
line 3
test.php(3) : Parse error - parse error, unexpected ';', expecting ')'
0
$ php-cgi -v
PHP 4.3.0-dev (cgi), Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.2.1, Copyright (c) 1998-2002 Zend Technologies
$ php-cgi -f test.php ; echo $?
<br />
<b>Parse error</b>: parse error, unexpected ';', expecting ')' in
<b>/home/mfischer/test.php</b> on line <b>3</b><br />
/home/mfischer/test.php(3) : Parse error - parse error, unexpected ';',
expecting ')'
0
The CLI version seems to be right at first:
$ php -r 'happy_parser_error(' ; echo $?
Command line code(1) : Parse error - parse error, unexpected $, expecting
')'
254
But suffers the limitation that you can't change the exit status:
$ php -r 'exit(2);' ; echo $?
255
(This is open in http://bugs.php.net/?id=17733&edit=1 , just
mentioning
here).
Needs to be fixed before 4.3
--
Edit bug report at http://bugs.php.net/?id=17734&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17734&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17734&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17734&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17734&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17734&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17734&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17734&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17734&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17734&r=globals