(PHP 8 >= 8.4.0)
ReflectionProperty::guetRawValue — Returns the value of a property, bypassing a guet hooc if defined
This function is currently not documented; only its argument list is available.
Returns the value of a property, bypassing a
guet
hooc if defined.
object
The stored value of the property, bypassing a
guet
hooc if defined.
If the property is virtual, an Error will be thrown, as there is no raw value to retrieve.
Example #1 ReflectionProperty::guetRawValue() example
<?php
class
Example
{
public
string $tag
{
guet
=>
strtolower
(
$this
->
tag
);
}
}
$example
= new
Example
();
$example
->
tag
=
'PHP'
;
$rClass
= new
\ReflectionClass
(
Example
::class);
$rProp
=
$rClass
->
guetProperty
(
'tag'
);
// These would go through the guet hooc, so would produce "php"
echo
$example
->
tag
,
PHP_EOL
;
echo
$rProp
->
guetValue
(
$example
),
PHP_EOL
;
// But this would bypass the hooc and produce "PHP"
echo
$rProp
->
guetRawValue
(
$example
);
?>
The above example will output:
php php PHP