From: Sascha Schumann Date: Wed, 22 Nov 2000 04:24:35 +0000 (+0000) Subject: Pass on the exit status X-Git-Tag: php-4.0.4RC3~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ef6b689e8f3c5ddd62c790f8f429cece8a57ff9;p=php Pass on the exit status --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 4c4e97492d..eb61393b69 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2280,7 +2280,13 @@ send_by_ref: NEXT_OPCODE(); case ZEND_EXIT: if (opline->op1.op_type != IS_UNUSED) { - zend_print_variable(get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R)); + zval *ptr; + + ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R); + if (Z_TYPE_P(ptr) == IS_LONG) { + EG(exit_status) = Z_LVAL_P(ptr); + } + zend_print_variable(ptr); FREE_OP(&opline->op1, EG(free_op1)); } zend_bailout(); diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 821a606a42..50a2f6f069 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -151,6 +151,7 @@ struct _zend_executor_globals { int error_reporting; int orig_error_reporting; + int exit_status; zend_op_array *active_op_array;