xref: /PHP-8.1/ext/reflection/tests/bug39884.phpt (revision 93640db4)
1--TEST--
2Bug #39884 (ReflectionParameter::getClass() throws exception for type hint self)
3--FILE--
4<?php
5class stubParamTest
6{
7    function paramTest(self $param)
8    {
9        // nothing to do
10    }
11}
12$test1 = new stubParamTest();
13$test2 = new stubParamTest();
14$test1->paramTest($test2);
15$refParam = new ReflectionParameter(array('stubParamTest', 'paramTest'), 'param');
16var_dump($refParam->getClass());
17?>
18--EXPECTF--
19Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
20object(ReflectionClass)#4 (1) {
21  ["name"]=>
22  string(13) "stubParamTest"
23}
24