|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2015, PHP 7.0.1
+- Core:
+ . 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)
HT_ASSERT(GC_REFCOUNT(ht) == 1);
HASH_PROTECT_RECURSION(ht);
- p = ht->arData;
- for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
+ for (idx = 0; idx < ht->nNumUsed; idx++) {
+ p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val);
HT_ASSERT(GC_REFCOUNT(ht) == 1);
HASH_PROTECT_RECURSION(ht);
- p = ht->arData;
- for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
+ for (idx = 0; idx < ht->nNumUsed; idx++) {
+ p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val, argument);
HASH_PROTECT_RECURSION(ht);
- p = ht->arData;
- for (idx = 0; idx < ht->nNumUsed; idx++, p++) {
+ for (idx = 0; idx < ht->nNumUsed; idx++) {
+ p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
va_start(args, num_args);
hash_key.h = p->h;
HASH_PROTECT_RECURSION(ht);
idx = ht->nNumUsed;
- p = ht->arData + idx;
while (idx > 0) {
idx--;
- p--;
+ p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
result = apply_func(&p->val);
--- /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