(PHP 8 >= 8.4.0)
ReflectionProperty::hasHook — Returns whether the property has a given hook defined.
Returns whether the property has a given hook defined.
PropertyHookType
例1 ReflectionProperty::hasHook() example
<?php
class Example
{
public string $name { get => "Name here"; }
}
$rClass = new \ReflectionClass(Example::class);
$rProp = $rClass->getProperty('name');
var_dump($rProp->hasHook(PropertyHookType::Get));
var_dump($rProp->hasHook(PropertyHookType::Set));
?>