- var_dump: documentation ( source)
<?php
class B
{
public function test(): B
{
}
}
function getB(): B
{
}
$rc = new ReflectionMethod('B', 'test');
var_dump((string)$rc->getReturnType(), $rc->getReturnType());
$rc = new ReflectionFunction('getB');
var_dump((string)$rc->getReturnType(), $rc->getReturnType());