xref: /PHP-8.1/ext/spl/tests/observer_010.phpt (revision 7aacc705)
1--TEST--
2SPL: 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';
10var_dump($map[$b] ?? null);
11var_dump($map[$a] ?? null);
12?>
13--EXPECT--
14NULL
15string(3) "foo"
16