(PHP 8 >= 8.4.0)
ReflectionProperty::hasHooks — Returns whether the property has any hooks defined
This function is currently not documented; only its argument list is available.
Returns whether the property has any hooks defined.
This function has no parameters.
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)
Note: This method is equivalent to checking ReflectionProperty::getHooks() against an empty array.
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant