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

ReflectionProperty::isInitialized

(PHP 7 >= 7.4.0, PHP 8)

ReflectionProperty::isInitializedChecks whether a property is initialized

說(shuō)明

public ReflectionProperty::isInitialized(?object $object = null): bool

Checks whether a property is initialized.

參數

object

If the property is non-static an object must be provided to fetch the property from.

返回值

Returns false for typed properties prior to initialization, and for properties that have been explicitly unset(). For all other properties true will be returned.

錯誤/異常

Throws a ReflectionException if the property is inaccessible. You can make a protected or private property accessible using ReflectionProperty::setAccessible().

更新日志

版本 說(shuō)明
8.0.0 object is nullable now.

范例

示例 #1 ReflectionProperty::isInitialized() example

<?php
class User
{
    public 
string $name;
}

$rp = new ReflectionProperty('User''name');
$user = new User;
var_dump($rp->isInitialized($user));
$user->name 'Nikita';
var_dump($rp->isInitialized($user));
?>

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

bool(false)
bool(true)

參見(jiàn)

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