observer_010.phpt 339 B

123456789101112131415
  1. --TEST--
  2. SPL: SplObjectStorage null coalescing operator memory leak
  3. --FILE--
  4. <?php
  5. // In zts mode, this should no longer detect memory leaks for the objects
  6. $a = new stdClass();
  7. $b = new stdClass();
  8. $map = new SplObjectStorage();
  9. $map[$a] = 'foo';
  10. var_dump($map[$b] ?? null);
  11. var_dump($map[$a] ?? null);
  12. ?>
  13. --EXPECT--
  14. NULL
  15. string(3) "foo"