xref: /PHP-7.4/ext/spl/tests/observer_010.phpt (revision 8ef2121e)
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--EXPECT--
13NULL
14string(3) "foo"
15