com php-src: 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:
Zend/tests/bug64720.phpt Zend/tests/bug68652.phpt Zend/tests/bug74053.phpt
| From: | Dmitry Stogov | Date: | Tue, 07 Feb 2017 14:19:16 +0000 |
| Subject: | com php-src: 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: Zend/tests/bug64720.phpt Zend/tests/bug68652.phpt Zend/tests/bug74053.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97051@lists.php.net to get a copy of this message | ||
Commit: d94b067504dd949a52fb777fe0b505ab522a8682
Author: Jim Zubov <jim@commercebyte.com> Tue, 7 Feb 2017 09:19:16 -0500
Parents: 9a8a1c9da129a72c9bf8f3392f954a9e5ca317ff
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d94b067504dd949a52fb777fe0b505ab522a8682
Log:
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
[Anybody please advice if I'm wrong?]
Also created bug74053.phpt, for the code I mentioned in the bug description
Bugs:
https://bugs.php.net/64720
https://bugs.php.net/68652
https://bugs.php.net/74053
Changed paths:
M Zend/tests/bug64720.phpt
M Zend/tests/bug68652.phpt
A Zend/tests/bug74053.phpt
Diff:
diff --git a/Zend/tests/bug64720.phpt b/Zend/tests/bug64720.phpt
index 45dee3e..35b01e6 100644
--- a/Zend/tests/bug64720.phpt
+++ b/Zend/tests/bug64720.phpt
@@ -45,8 +45,3 @@ $bar = new Bar();
$bar->test();
?>
--EXPECTF--
-Fatal error: Uncaught Error: Access to undeclared static property: Stat::$requests in
%sbug64720.php:12
-Stack trace:
-#0 [internal function]: Stat->__destruct()
-#1 {main}
- thrown in %sbug64720.php on line 12
diff --git a/Zend/tests/bug68652.phpt b/Zend/tests/bug68652.phpt
index 8e54af2..f0c9d5e 100644
--- a/Zend/tests/bug68652.phpt
+++ b/Zend/tests/bug68652.phpt
@@ -37,10 +37,3 @@ class Bar {
$foo = new Foo();
?>
--EXPECTF--
-Fatal error: Uncaught Error: Access to undeclared static property: Bar::$instance in
%sbug68652.php:%d
-Stack trace:
-#0 %s(%d): Bar::getInstance()
-#1 [internal function]: Foo->__destruct()
-#2 {main}
- thrown in %sbug68652.php on line %d
-
diff --git a/Zend/tests/bug74053.phpt b/Zend/tests/bug74053.phpt
new file mode 100644
index 0000000..e8fc02d
--- /dev/null
+++ b/Zend/tests/bug74053.phpt
@@ -0,0 +1,43 @@
+--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;
+?>
+--EXPECTF--
+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