Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ReflectionProperty::hasHookReflectionProperty::hasType>
^ReflectionPropertyLast updated: Mon, 26 Oct 2026

ReflectionProperty::hasHooks

(PHP 8 >= 8.4.0)

ReflectionProperty::hasHooks — Returns whether the property has any hooks defined

Description

public function ReflectionProperty::hasHooks(): bool
Warning

This function is currently not documented; only its argument list is available.

Returns whether the property has any hooks defined.

Parameters

This function has no parameters.

Return Values

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

Examples

Example #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());
?>

The above example will output:

bool(true)
bool(false)

Notes

Note:

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

See Also


<ReflectionProperty::hasHookReflectionProperty::hasType>
^ReflectionPropertyLast updated: Mon, 26 Oct 2026