ReflectionProperty::isInitialized() - php 反射机制
ReflectionProperty::isInitialized()
(PHP 7 >= 7.4.0)
Checks whether a property is initialized
说明
publicReflectionProperty::isInitialized([object $object] ): boolChecks whether a property is initialized.
参数
$objectIf the property is non-static an object must be provided to fetch the property from.
返回值
ReturnsFALSE
for typed properties prior to initialization, and for properties that have been explicitlyunset(). For all other propertiesTRUE
will be returned.
错误/异常
Throws aReflectionExceptionif the property is inaccessible. You can make a protected or private property accessible usingReflectionProperty::setAccessible().
范例
Example #1ReflectionProperty::isInitialized()example
以上例程会输出:
bool(false) bool(true)
参见
- ReflectionProperty::hasType() Checks if property has a type
鹏仔微信 15129739599 鹏仔QQ344225443 鹏仔前端 pjxi.com 共享博客 sharedbk.com
图片声明:本站部分配图来自网络。本站只作为美观性配图使用,无任何非法侵犯第三方意图,一切解释权归图片著作权方,本站不承担任何责任。如有恶意碰瓷者,必当奉陪到底严惩不贷!