Hi:because in PHP exit is implements by set/longjmp
when use set_error_handler, and call exit in use_handler,
according to the normal sequence
1. php_stream_wrapper_log_error
2. php_stream_display_wrapper_errors
-> php_error_docref1
3. php_stream_tidy_wrapper_error_log
the actual execution sequence will be:
--
|
diff -Naur php-5.2.14/main/streams/streams.c
php-5.2.14-new/main/streams/streams.c
--- php-5.2.14/main/streams/streams.c 2010-09-27 23:29:13.000000000 +0800
+++ php-5.2.14-new/main/streams/streams.c 2010-09-28 10:38:22.000000000
+0800
@@ -175,6 +175,7 @@
}
php_strip_url_passwd(tmp);
+ php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC);
php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption,
msg);
efree(tmp);
if (free_msg) {
@@ -1773,7 +1774,6 @@
if (stream == NULL && (options & REPORT_ERRORS)) {
php_stream_display_wrapper_errors(wrapper, path, "failed to
open dir" TSRMLS_CC);
}
- php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC);
return stream;
}
@@ -1896,7 +1896,6 @@
*opened_path = NULL;
}
}
- php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC);
#if ZEND_DEBUG
if (stream == NULL && copy_of_path != NULL) {
pefree(copy_of_path, persistent);
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
