(PHP 8 >= 8.4.0)
ReflectionProperty::hasHooks — Returns whether the property has any hooks defined
本函数还未编写文档,仅有参数列表。
Returns whether the property has any hooks defined.
此函数没有参数。
示例 #1 ReflectionProperty::hasHooks() example
<?php
class Example
{
public string $name { get => "Name here"; }
public string $none;
}
$rClass = new \ReflectionClass(Example::class);
var_dump($rClass->getProperty('name')->hasHooks());
var_dump($rClass->getProperty('none')->hasHooks());
?>
以上示例会输出:
bool(true) bool(false)
注意: This method is equivalent to checking ReflectionProperty::getHooks() against an empty array.