|
ReflectionProperty::__constructConstruct a ReflectionProperty object Description
public ReflectionProperty::__construct
( mixed
$class
, string $name
)
Warning
This function is currently not documented; only its argument list is available. Parameters
Return ValuesNo value is returned. Errors/ExceptionsTrying to get or set private or protected class property's values will result in an exception being thrown. Examples
Example #1 ReflectionProperty::__construct example
<?php The above example will output something similar to: ===> 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) } Example #2 Getting value from private and protected properties using ReflectionProperty class
<?php The above example will output something similar to: int(2) int(3) |