The ReflectionProperty class lets you reverse-engineer class properties.
<?php
class ReflectionProperty implements Reflector {
public __construct(mixed class, string name)
public string getName()
public bool isPublic()
public bool isPrivate()
public bool isProtected()
public bool isStatic()
public bool isDefault()
public int getModifiers()
public mixed getValue(stdclass object)
public void setValue(stdclass object, mixed value)
public ReflectionClass getDeclaringClass()
public string toString()
}
?> |
To introspect a method, you will first have to create an instance of the ReflectionProperty class. You can then call any of the above methods on this instance.
Note: Trying to get or set private or protected class property's values will result in an exception being thrown.