xref: /PHP-7.0/ext/spl/tests/observer_010.phpt (revision cdb7aafc)
1--TEST--
2SPL: SplObjectStorage null coalescing operator memory leak
3--FILE--
4<?php
5// In maintainer zts mode, this should no longer
6// detect memory leaks for the objects
7$a = new stdClass();
8$b = new stdClass();
9$map = new SplObjectStorage();
10$map[$a] = 'foo';
11var_dump($map[$b] ?? null);
12var_dump($map[$a] ?? null);
13--EXPECTF--
14NULL
15string(3) "foo"
16