ReflectionProperty
class ReflectionProperty implements Reflector (View source)
The ReflectionProperty class reports information about a classes properties.
Constants
IS_ABSTRACT
Since: 8.4
|
|
IS_VIRTUAL
Since: 8.4
|
|
IS_STATIC |
Indicates that the property is static. |
IS_PUBLIC |
Indicates that the property is public. |
IS_PROTECTED |
Indicates that the property is protected. |
IS_PRIVATE |
Indicates that the property is private. |
IS_READONLY
Since: 8.1
|
|
IS_PROTECTED_SET
Since: 8.4
|
|
IS_PRIVATE_SET
Since: 8.4
|
|
IS_FINAL
Since: 8.4
|
|
Properties
string | $name | ||
string | $class |
Methods
Construct a ReflectionProperty object
Export
To string
Gets property name
Gets value
Set property value
Checks if property is public
Checks if property is private
Checks if property is protected
Checks if property is static
Checks if default value
Gets modifiers
Gets declaring class
Gets doc comment
Set property accessibility This method is no-op starting from PHP 8.1
Gets property type
Checks if property has type
Checks if property is initialized
Returns information about whether the property was promoted.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
__construct(string|object $class, string $property)
Construct a ReflectionProperty object
static string|null
export(mixed $class, string $name, bool $return = false)
Export
string
__toString()
To string
string
getName()
Gets property name
mixed
getValue(object|null $object = null)
Gets value
void
setValue(mixed $objectOrValue, mixed $value)
Set property value
bool
isPublic()
Checks if property is public
bool
isPrivate()
Checks if property is private
bool
isProtected()
Checks if property is protected
bool
isStatic()
Checks if property is static
bool
isDefault()
Checks if default value
int
getModifiers()
Gets modifiers
ReflectionClass
getDeclaringClass()
Gets declaring class
string|false
getDocComment()
Gets doc comment
void
setAccessible(bool $accessible)
Set property accessibility This method is no-op starting from PHP 8.1
ReflectionType|null
getType()
Gets property type
bool
hasType()
Checks if property has type
bool
isInitialized(object|null $object = null)
Checks if property is initialized
bool
isPromoted()
Returns information about whether the property was promoted.
bool
hasDefaultValue()
No description
mixed
getDefaultValue()
No description
array
getAttributes(string|null $name = null, int $flags = 0)
No description
bool
isReadOnly()
No description
mixed
getRawValue(object $object)
No description
void
setRawValue(object $object, mixed $value)
No description
bool
isAbstract()
No description
bool
isVirtual()
No description
ReflectionType|null
getSettableType()
No description
bool
hasHooks()
No description
array
getHooks()
No description
bool
hasHook(PropertyHookType $type)
No description
ReflectionMethod|null
getHook(PropertyHookType $type)
No description
bool
isPrivateSet()
No description
bool
isProtectedSet()
No description
void
setRawValueWithoutLazyInitialization(object $object, mixed $value)
No description
void
skipLazyInitialization(object $object)
No description
bool
isDynamic()
No description
bool
isFinal()
No description
bool
isLazy(object $object)
No description