diff options
-rw-r--r-- | sapi/cli/php_cli.c | 5 | ||||
-rw-r--r-- | sapi/cli/php_cli_server.c | 3 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg.c | 13 | ||||
-rw-r--r-- | sapi/phpdbg/tests/commands/0107_compile.test | 17 |
4 files changed, 30 insertions, 8 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 8a8e113db0..81eba9a83a 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1178,9 +1178,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine int main(int argc, char *argv[]) #endif { -#ifdef ZTS - void ***tsrm_ls; -#endif #ifdef PHP_CLI_WIN32_NO_CONSOLE int argc = __argc; char **argv = __argv; @@ -1236,7 +1233,7 @@ int main(int argc, char *argv[]) #ifdef ZTS tsrm_startup(1, 1, 0, NULL); - tsrm_ls = ts_resource(0); + (void)ts_resource(0); ZEND_TSRMLS_CACHE_UPDATE; #endif diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 64acd9a682..6315cd8ae5 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -419,9 +419,6 @@ PHP_FUNCTION(apache_response_headers) /* {{{ */ return; } - if (!&SG(sapi_headers).headers) { - RETURN_FALSE; - } array_init(return_value); zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value); } diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 3337f05cdc..74bf84adff 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -65,6 +65,7 @@ PHP_INI_BEGIN() PHP_INI_END() static zend_bool phpdbg_booted = 0; +static zend_bool phpdbg_fully_started = 0; #if PHP_VERSION_ID >= 50500 void (*zend_execute_old)(zend_execute_data *execute_data); @@ -523,6 +524,10 @@ static void php_sapi_phpdbg_log_message(char *message) /* {{{ */ phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); efree(file); + if (!phpdbg_fully_started) { + return; + } + do { switch (phpdbg_interactive(1)) { case PHPDBG_LEAVE: @@ -1476,7 +1481,11 @@ phpdbg_main: if (settings) { PHPDBG_G(flags) |= PHPDBG_DISCARD_OUTPUT; } - phpdbg_compile(); + + zend_try { + phpdbg_compile(); + } zend_end_try(); + PHPDBG_G(flags) &= ~PHPDBG_DISCARD_OUTPUT; } @@ -1485,6 +1494,8 @@ phpdbg_main: PHPDBG_G(flags) |= PHPDBG_IS_STEPPING; } + phpdbg_fully_started = 1; + /* #ifndef for making compiler shutting up */ #ifndef _WIN32 phpdbg_interact: diff --git a/sapi/phpdbg/tests/commands/0107_compile.test b/sapi/phpdbg/tests/commands/0107_compile.test new file mode 100644 index 0000000000..4842cb74f1 --- /dev/null +++ b/sapi/phpdbg/tests/commands/0107_compile.test @@ -0,0 +1,17 @@ +################################################# +# name: compile +# purpose: test compiling error code +# expect: TEST::FORMAT +# options: -rr +################################################# +#[PHP Parse error: syntax error, unexpected 'echo' (T_ECHO) in %s on line %s] +#[Could not find information about included file...] +################################################# +<: +define('OUT', + tempnam(null, "phpdbg")); +file_put_contents(OUT, "<?error echo \"Hello World\"; ?>"); +phpdbg_exec(OUT); +:> +run +quit |