We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e2494f commit 2f84241Copy full SHA for 2f84241
Zend/tests/gh18833.phpt
@@ -0,0 +1,24 @@
1
+--TEST--
2
+Bug #18833 (Use after free with weakmaps dependent on destruction order)
3
+--FILE--
4
+<?php
5
+
6
+class a {
7
+ public static WeakMap $map;
8
+ public static Generator $storage;
9
+}
10
11
+a::$map = new WeakMap;
12
13
+$closure = function () {
14
+ $obj = new a;
15
+ a::$map[$obj] = true;
16
+ yield $obj;
17
+};
18
+a::$storage = $closure();
19
+a::$storage->current();
20
21
+echo "ok\n";
22
+?>
23
+--EXPECT--
24
+ok
0 commit comments