ReflectionFunctionAbstract::hasTentativeReturnType
仮の戻り値の型を宣言しているかを返す
説明
public bool ReflectionFunctionAbstract::hasTentativeReturnType()
関数が仮の戻り値の型を宣言しているかどうかを返します。
戻り値
関数が仮の戻り値の型を持つ場合、true を返します。
そうでない場合、false を返します。
例
例1 ReflectionFunctionAbstract::hasTentativeReturnType の例
<?php
$method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet');
var_dump($method->hasTentativeReturnType());
参考
- ReflectionFunctionAbstract::getTentativeReturnType
- ReflectionFunctionAbstract::hasReturnType
- 内部クラスと戻り値の型の互換性