php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19224 no way to return 0 exit status in CLI
Submitted: 2002-09-04 02:22 UTC Modified: 2002-09-04 02:31 UTC
From: tdv at edisoft dot ru Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.2 OS:
Private report: No CVE-ID: None
 [2002-09-04 02:22 UTC] tdv at edisoft dot ru
The command line interface CLI of PHP could NOT return 0 (zero) exit status from the script.
I look through the source and found folowing code (in sapi/cli/php_cli.c:586:

        switch (behavior) {
        case PHP_MODE_STANDARD:
            if (php_execute_script(&file_handle TSRMLS_CC)) {
                exit_status = EG(exit_status);
            } else {
                exit_status = 255;
            }
            break;

As I see, there is NO way to return 0 (normal) exit status.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-04 02:31 UTC] derick@php.net
Fixed in CVS, and this will be fixed as soon as 4.2.3 comes out:

[derick@kossu /tmp]$ php-4.2.3RC2
<?php
exit(0);
?>
[derick@kossu /tmp]$ echo $?
0

Derick
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 19:01:32 2024 UTC