Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some basic test for it

  • Loading branch information...
commit 36049c02b3c70ebaab9b0c911e94e4486e9e8e0f 1 parent 92c5417
@colder authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 tests/weakmap_001.phpt
View
30 tests/weakmap_001.phpt
@@ -0,0 +1,30 @@
+--TEST--
+WeakMap: usage
+--FILE--
+<?php
+$wm = new WeakMap();
+
+$o = new StdClass;
+
+class A {
+ public function __destruct() {
+ echo "Dead!\n";
+ }
+}
+
+$wm[$o] = new A;
+
+var_dump(count($wm));
+echo "Unsetting..\n";
+unset($o);
+echo "Done\n";
+var_dump(count($wm));
+?>
+==END==
+--EXPECTF--
+int(1)
+Unsetting..
+Dead!
+Done
+int(0)
+==END==
Please sign in to comment.
Something went wrong with that request. Please try again.