(PHP 8 >= 8.4.0)
ReflectionProperty::hasHooks — Returns whether the property has any hooks defined
Наразі ця функція не документована. Доступний лише список її параметрів.
Returns whether the property has any hooks defined.
У цієї функції немає параметрів.
Returns true
if the property has at least one hook defined, false
otherwise.
Приклад #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.