|
ReflectionProperty::__constructConstruct a ReflectionProperty object Beschreibung
public ReflectionProperty::__construct
( mixed
$class
, string $name
)
Warnung
Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung. Parameter-Liste
RückgabewerteEs wird kein Wert zurückgegeben. Fehler/ExceptionsTrying to get or set private or protected class property's values will result in an exception being thrown. Beispiele
Beispiel #1 ReflectionProperty::__construct example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
===> The public property 'length' (which was declared at compile-time)
having the modifiers array (
0 => 'public',
)
---> Value is: int(5)
---> Setting value to 10, new value is: int(10)
object(Str)#2 (1) {
["length"]=>
int(10)
}
Beispiel #2 Getting value from private and protected properties using ReflectionProperty class
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie: int(2) int(3) |