public function limitObject($var, $depth, array &$references)
    {
        $hash = spl_object_hash($var);

        if (in_array($hash, $references)) {
            return '*RECURSION*';
        }

        $references[] = $hash;
        $ref = new \ReflectionObject($var);
        foreach ($ref->getProperties() as $prop) {
            $prop->setAccessible(true);

            $prop->setValue($var, $this->limit($prop->getValue($var), $depth + 1, $references));
        }

        return $var;
    }
public function limitObject($var, $depth, array &$references)
    {
        $hash = spl_object_hash($var);

        if (in_array($hash, $references)) {
            return '*RECURSION*';
        }

        $references[] = $hash;
        $ref = new \ReflectionObject($var);
        foreach ($ref->getProperties() as $prop) {
            $prop->setAccessible(true);

            $prop->setValue($var, $this->limit($prop->getValue($var), $depth + 1, $references));
        }

        return $var;
    }
public function limitObject ( $ var , $ depth , array & $ references ) { $ hash = spl_object_hash ( $ var ) ; if ( in_array ( $ hash , $ references ) ) { return '*RECURSION*' ; } $ references [ ] = $ hash ; $ ref = new \ ReflectionObject ( $ var ) ; foreach ( $ ref -> getProperties ( ) as $ prop ) { $ prop -> setAccessible ( true ) ; $ prop -> setValue ( $ var , $ this -> limit ( $ prop -> getValue ( $ var ) , $ depth + 1 , $ references ) ) ; } return $ var ; }
Limits dumped object

@param mixed $var
@param int   $depth
@param array $references

@return string
Limits dumped object