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