男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

ReflectionFunctionAbstract::hasReturnType

(PHP 7, PHP 8)

ReflectionFunctionAbstract::hasReturnTypeChecks if the function has a specified return type

說(shuō)明

public ReflectionFunctionAbstract::hasReturnType(): bool

Checks whether the reflected function has a return type specified.

參數

此函數沒(méi)有參數。

返回值

Returns true if the function is a specified return type, otherwise false.

范例

示例 #1 ReflectionFunctionAbstract::hasReturnType() example

<?php

function to_int($param) : int {
    return (int) 
$param;
}

$reflection1 = new ReflectionFunction('to_int');
var_dump($reflection1->hasReturnType());

以上例程會(huì )輸出:

bool(true)

示例 #2 Usage on built-in functions

<?php

$reflection2 
= new ReflectionFunction('array_merge');

var_dump($reflection2->hasReturnType());

以上例程會(huì )輸出:

bool(false)

This is because many internal functions do not have types specified for their parameters or return values. It is therefore best to avoid using this method on built-in functions.

參見(jiàn)

男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站