Skip to content

Commit f40c031

Browse files
bwoebiweltling
authored andcommitted
Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1
(cherry picked from commit 457e68626257e8b5c891f2edf20d31907080063a)
1 parent 6baaccc commit f40c031

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

sapi/phpdbg/phpdbg.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,12 @@ int main(int argc, char **argv) /* {{{ */
20622062
php_request_shutdown(NULL);
20632063
} zend_end_try();
20642064

2065+
if (PHPDBG_G(exec) && !memcmp("-", PHPDBG_G(exec), 2)) { /* i.e. execution context has been read from stdin - back it up */
2066+
phpdbg_file_source *data = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), PHPDBG_G(exec), PHPDBG_G(exec_len));
2067+
backup_phpdbg_compile = zend_string_alloc(data->len + 2, 1);
2068+
sprintf(ZSTR_VAL(backup_phpdbg_compile), "?>%.*s", (int) data->len, data->buf);
2069+
}
2070+
20652071
/* backup globals when cleaning */
20662072
if ((cleaning > 0 || remote) && !quit_immediately) {
20672073
settings = calloc(1, sizeof(zend_phpdbg_globals));
@@ -2114,12 +2120,6 @@ int main(int argc, char **argv) /* {{{ */
21142120
wrapper->wops->stream_opener = PHPDBG_G(orig_url_wrap_php);
21152121
}
21162122

2117-
if (PHPDBG_G(exec) && !memcmp("-", PHPDBG_G(exec), 2)) { /* i.e. execution context has been read from stdin - back it up */
2118-
phpdbg_file_source *data = zend_hash_str_find_ptr(&PHPDBG_G(file_sources), PHPDBG_G(exec), PHPDBG_G(exec_len));
2119-
backup_phpdbg_compile = zend_string_alloc(data->len + 2, 1);
2120-
sprintf(ZSTR_VAL(backup_phpdbg_compile), "?>%.*s", (int) data->len, data->buf);
2121-
}
2122-
21232123
zend_try {
21242124
php_module_shutdown();
21252125
} zend_end_try();

sapi/phpdbg/tests/include.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
echo 1;

0 commit comments

Comments
 (0)