Issue: https://github.com/php/php-src/issues/12440
Author: JoshyPHP
### Description
DOM methods do not provide a return type when inspected via ReflectionMethod. I'm
not sure whether it's by design, an oversight, or a bug. The [DOM
stub](https://github.com/php/php-src/blob/d0b29d82863789cae658d13ccc8153c01c8a4d0c/ext/dom/php_dom.stub.php#L786-L787)
has return type annotations but no actual return type. As far as I can tell, DOM properties can be
inspected normally too.
The following code:
```php
<?php declare(strict_types=1);
$class = new ReflectionClass('DOMDocument');
$method = $class->getMethod('createElement');
$property = $class->getProperty('documentElement');
var_dump(
phpversion(),
$method->getReturnType(),
$method->getTentativeReturnType(),
$property->getType()->getName()
);
```
Resulted in this output:
```
string(8) "8.3.0RC4"
NULL
NULL
string(10) "DOMElement"
```
But I expected this output instead:
```
string(8) "8.3.0RC4"
object(ReflectionNamedType)
NULL
string(10) "DOMElement"
```
### PHP Version
8.3.0RC4
### Operating System
_No response_