summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/ReflectionType_002.phpt
blob: 501dfc8d893ea71669dd767fc250efe491d7475b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
ReflectionType leak
--FILE--
<?php

$closure = function(Test $x): Test2 { return new Test2($x); };
$rm = new ReflectionMethod($closure, '__invoke');
$rp = $rm->getParameters()[0];
$rt = $rp->getType();
$rrt = $rm->getReturnType();
unset($rm, $rp);
var_dump($rt->getName(), $rrt->getName());

--EXPECT--
string(4) "Test"
string(5) "Test2"