Skip to content

Commit 07c61c2

Browse files
committed
Merge branch 'PHP-5.4'
2 parents ba568aa + ba27e08 commit 07c61c2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Zend/zend.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,13 +1261,23 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
12611261
zend_file_handle *file_handle;
12621262
zend_op_array *orig_op_array = EG(active_op_array);
12631263
zval **orig_retval_ptr_ptr = EG(return_value_ptr_ptr);
1264+
long orig_interactive = CG(interactive);
12641265

12651266
va_start(files, file_count);
12661267
for (i = 0; i < file_count; i++) {
12671268
file_handle = va_arg(files, zend_file_handle *);
12681269
if (!file_handle) {
12691270
continue;
12701271
}
1272+
1273+
if (orig_interactive) {
1274+
if (file_handle->filename[0] != '-' || file_handle->filename[1]) {
1275+
CG(interactive) = 0;
1276+
} else {
1277+
CG(interactive) = 1;
1278+
}
1279+
}
1280+
12711281
EG(active_op_array) = zend_compile_file(file_handle, type TSRMLS_CC);
12721282
if (file_handle->opened_path) {
12731283
int dummy = 1;
@@ -1309,12 +1319,14 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
13091319
va_end(files);
13101320
EG(active_op_array) = orig_op_array;
13111321
EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
1322+
CG(interactive) = orig_interactive;
13121323
return FAILURE;
13131324
}
13141325
}
13151326
va_end(files);
13161327
EG(active_op_array) = orig_op_array;
13171328
EG(return_value_ptr_ptr) = orig_retval_ptr_ptr;
1329+
CG(interactive) = orig_interactive;
13181330

13191331
return SUCCESS;
13201332
}

0 commit comments

Comments
 (0)