Skip to content

Commit 54a8318

Browse files
committed
Respect exit status for -rr option with phpdbg
1 parent 5f006ad commit 54a8318

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sapi/phpdbg/phpdbg.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,7 @@ int main(int argc, char **argv) /* {{{ */
13001300
zend_bool ext_stmt = 0;
13011301
zend_bool use_mm_wrappers = 0;
13021302
zend_bool is_exit;
1303+
int exit_status = 0;
13031304

13041305
#ifdef ZTS
13051306
void ***tsrm_ls;
@@ -1822,6 +1823,7 @@ int main(int argc, char **argv) /* {{{ */
18221823
if (quit_immediately) {
18231824
/* if -r is on the command line more than once just quit */
18241825
EG(bailout) = __orig_bailout; /* reset zend_try */
1826+
exit_status = EG(exit_status);
18251827
break;
18261828
}
18271829
}
@@ -1998,5 +2000,6 @@ int main(int argc, char **argv) /* {{{ */
19982000
free(PHPDBG_G(sapi_name_ptr));
19992001
}
20002002

2001-
return 0;
2003+
/* usually 0; just for -rr */
2004+
return exit_status;
20022005
} /* }}} */

0 commit comments

Comments
 (0)