public function findProperty($class, $name)
    {
        $reflection = new ReflectionClass($class);

        while (false === $reflection->hasProperty($name)) {
            if (false === ($reflection = $reflection->getParentClass())) {
                throw new ReflectionException(sprintf(
                    'The property "%s" does not exist in the class "%s".',
                    $name,
                    is_object($class) ? get_class($class) : $class
                ));
            }
        }

        return $reflection->getProperty($name);
    }
public function findProperty($class, $name)
    {
        $reflection = new ReflectionClass($class);

        while (false === $reflection->hasProperty($name)) {
            if (false === ($reflection = $reflection->getParentClass())) {
                throw new ReflectionException(sprintf(
                    'The property "%s" does not exist in the class "%s".',
                    $name,
                    is_object($class) ? get_class($class) : $class
                ));
            }
        }

        return $reflection->getProperty($name);
    }
public function findProperty ( $ class , $ name ) { $ reflection = new ReflectionClass ( $ class ) ; while ( false === $ reflection -> hasProperty ( $ name ) ) { if ( false === ( $ reflection = $ reflection -> getParentClass ( ) ) ) { throw new ReflectionException ( sprintf ( 'The property "%s" does not exist in the class "%s".' , $ name , is_object ( $ class ) ? get_class ( $ class ) : $ class ) ) ; } } return $ reflection -> getProperty ( $ name ) ; }
Finds a class property and returns the ReflectionProperty instance.

@param object|string $class The class name or object.
@param string        $name  The property name.

@return ReflectionProperty The property instance.

@throws ReflectionException If the property is not found.
Finds a class property and returns the ReflectionProperty instance .