Tuesday, December 02, 2008

Freezing and Thawing PHP Objects

Freezing and Thawing PHP Objects - Sebastian Bergmann: "One of the many new features that have been added for PHP 5.3 is the setAccessible() method of the ReflectionProperty class that is part of PHP's Reflection API. This method makes protected and private attributes (unfortunately, the class is called ReflectionProperty instead of ReflectionAttribute) of a class or object accessible for the ReflectionProperty::getValue() and ReflectionProperty::setValue() methods, thus making protected and private attributes 'open' for full read and write access from the outside."