|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2015, PHP 7.0.1
+- Standard:
+ . Fixed bug #70249 (Segmentation fault while running PHPUnit tests on
+ phpBB 3.2-dev). (Laruence)
+
- Streams/Socket
. Add IPV6_V6ONLY constant / make it usable in stream contexts. (Bob)
{
if (BG(user_shutdown_function_names)) {
zend_try {
- zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call);
- }
- zend_end_try();
+ zval *entry;
+ for (zend_hash_internal_pointer_reset(BG(user_shutdown_function_names));
+ zend_hash_has_more_elements(BG(user_shutdown_function_names)) == SUCCESS;
+ zend_hash_move_forward(BG(user_shutdown_function_names))) {
+ if ((entry = zend_hash_get_current_data(BG(user_shutdown_function_names))) == NULL) {
+ continue;
+ }
+ user_shutdown_function_call(entry);
+ }
+ } zend_end_try();
php_free_shutdown_functions();
}
}
--- /dev/null
+--TEST--
+Bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
+--FILE--
+<?php
+
+class Logger {
+ public function __construct() {
+ register_shutdown_function(function () {
+ // make regular flush before other shutdown functions, which allows session data collection and so on
+ $this->flush();
+ // make sure log entries written by shutdown functions are also flushed
+ // ensure "flush()" is called last when there are multiple shutdown functions
+ register_shutdown_function([$this, 'flush'], true);
+ });
+ }
+
+ public function flush($final = false) {
+ return 1;
+ }
+}
+
+for ($i = 0; $i < 200; $i++) {
+ $a = new Logger();
+}
+?>
+okey
+--EXPECT--
+okey