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 d30c78d commit a690efcCopy full SHA for a690efc
Zend/tests/weakrefs/notify.phpt
@@ -0,0 +1,31 @@
1
+--TEST--
2
+Object free handler must call zend_weakrefs_notify
3
+--FILE--
4
+<?php
5
+
6
+$classes = get_declared_classes();
7
+$testedClasses = 0;
8
9
+foreach ($classes as $class) {
10
+ $reflector = new \ReflectionClass($class);
11
+ try {
12
+ $instance = $reflector->newInstanceWithoutConstructor();
13
+ } catch (\Throwable $e) {
14
+ continue;
15
+ }
16
+ $testedClasses++;
17
+ $ref = WeakReference::create($instance);
18
+ $instance = null;
19
+ gc_collect_cycles();
20
+ if ($ref->get() !== null) {
21
+ printf("free handler of %s did not call zend_weakrefs_notify?\n", $class);
22
23
+}
24
25
+if ($testedClasses === 0) {
26
+ print "Did not test any class\n";
27
28
+?>
29
+==DONE==
30
+--EXPECT--
31
0 commit comments