src/Freezer.php
public function readProperties($object)
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException(1, 'object');
        }

        $reflector = new \ReflectionObject($object);
        $result    = array();

        // Iterate over the properties of the object.
        foreach ($reflector->getProperties() as $property) {
            $property->setAccessible(true);
            $result[$property->getName()] = $property->getValue($object);
        }

        return $result;
    }
public function readProperties($object)
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException(1, 'object');
        }

        $reflector = new \ReflectionObject($object);
        $result    = array();

        // Iterate over the properties of the object.
        foreach ($reflector->getProperties() as $property) {
            $property->setAccessible(true);
            $result[$property->getName()] = $property->getValue($object);
        }

        return $result;
    }
public function readProperties ( $ object ) { if ( ! is_object ( $ object ) ) { throw new InvalidArgumentException ( 1 , 'object' ) ; } $ reflector = new \ ReflectionObject ( $ object ) ; $ result = array ( ) ; // Iterate over the properties of the object. foreach ( $ reflector -> getProperties ( ) as $ property ) { $ property -> setAccessible ( true ) ; $ result [ $ property -> getName ( ) ] = $ property -> getValue ( $ object ) ; } return $ result ; }
Returns an associative array of all properties of an object,
including those declared as protected or private.

@param  object $object The object for which all properties are returned.
@return array
@throws InvalidArgumentException
Returns an associative array of all properties of an object including those declared as protected or private .