array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'reflectionproperty.getrawvalue.php', 1 => 'ReflectionProperty::getRawValue', 2 => 'Returns the value of a property, bypassing a get hook if defined', ), 'up' => array ( 0 => 'class.reflectionproperty.php', 1 => 'ReflectionProperty', ), 'prev' => array ( 0 => 'reflectionproperty.getname.php', 1 => 'ReflectionProperty::getName', ), 'next' => array ( 0 => 'reflectionproperty.getsettabletype.php', 1 => 'ReflectionProperty::getSettableType', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/reflection/reflectionproperty/getrawvalue.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 8 >= 8.4.0)
ReflectionProperty::getRawValue — Returns the value of a property, bypassing a get hook if defined
Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.
Returns the value of a property, bypassing a get
hook if defined.
object
The stored value of the property, bypassing a get
hook if defined.
If the property is virtual, an Error will be thrown, as there is no raw value to retrieve.
Beispiel #1 ReflectionProperty::getRawValue() example
<?php
class Example
{
public string $tag {
get => strtolower($this->tag);
}
}
$example = new Example();
$example->tag = 'PHP';
$rClass = new \ReflectionClass(Example::class);
$rProp = $rClass->getProperty('tag');
// These would go through the get hook, so would produce "php"
echo $example->tag, PHP_EOL;
echo $rProp->getValue($example), PHP_EOL;
// But this would bypass the hook and produce "PHP"
echo $rProp->getRawValue($example);
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
php php PHP