ReflectionProperty::hasHooks

(PHP 8 >= 8.4.0)

ReflectionProperty::hasHooksReturns whether the property has any hooks defined

Açıklama

public ReflectionProperty::hasHooks(): bool
Uyarı

Bu işlev hala belgelendirilmemiştir; sadece bağımsız değişken listesi mevcuttur.

Returns whether the property has any hooks defined.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns true if the property has at least one hook defined, false otherwise.

Örnekler

Örnek 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());
?>

Yukarıdaki örneğin çıktısı:

bool(true)
bool(false)

Notlar

Bilginize: This method is equivalent to checking ReflectionProperty::getHooks() against an empty array.

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top