mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
c39147d136
Merge branch 'master' of github.com:commercebyte/php-src * 'master' of github.com:commercebyte/php-src: Added EG(flags) - executor global flags EG_FLAGS_IN_SHUTDOWN - is set when PHP is in shutdown state newly added zend_object_store.no_reuse is redefined as a global zend_object_store_no_reuse, to avoid alignment issues Alignment fix, as per @nikic The test scripts bug64720.phpt and bug68652.phpt were relying on the buggy behavior, when PHP returns "Undefined static property" error due to class entry corruption. With my fix for bug 74053, both tests return no errors now, I corrected the EXPECTF accordingly Bug Fix: Corrupted class entries on shutdown when a destructor spawns another object (C) 2017 CommerceByte Consulting
44 lines
640 B
PHP
44 lines
640 B
PHP
--TEST--
|
|
Bug #74053 (Corrupted class entries on shutdown when a destructor spawns another object)
|
|
--FILE--
|
|
<?php
|
|
class b {
|
|
function __destruct() {
|
|
echo "b::destruct\n";
|
|
}
|
|
}
|
|
class a {
|
|
static $b;
|
|
static $new;
|
|
static $max = 10;
|
|
function __destruct() {
|
|
if (self::$max-- <= 0) return;
|
|
echo "a::destruct\n";
|
|
self::$b = new b;
|
|
self::$new[] = new a;
|
|
}
|
|
}
|
|
new a;
|
|
?>
|
|
--EXPECT--
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|
|
a::destruct
|
|
b::destruct
|