original_string: public function dirsize()
      {
          $size = 0;
          $directory = Folder::slashTerm($this->path);
          $stack = [$directory];
          $count = count($stack);
          for ($i = 0, $j = $count; $i < $j; $i++) {
              if (is_file($stack[$i])) {
                  $size += filesize($stack[$i]);
              } elseif (is_dir($stack[$i])) {
                  $dir = dir($stack[$i]);
                  if ($dir) {
                      while (($entry = $dir->read()) !== false) {
                          if ($entry === '.' || $entry === '..') {
                              continue;
                          }
                          $add = $stack[$i] . $entry;
  
                          if (is_dir($stack[$i] . $entry)) {
                              $add = Folder::slashTerm($add);
                          }
                          $stack[] = $add;
                      }
                      $dir->close();
                  }
              }
              $j = count($stack);
          }
  
          return $size;
      }
code: public function dirsize()
      {
          $size = 0;
          $directory = Folder::slashTerm($this->path);
          $stack = [$directory];
          $count = count($stack);
          for ($i = 0, $j = $count; $i < $j; $i++) {
              if (is_file($stack[$i])) {
                  $size += filesize($stack[$i]);
              } elseif (is_dir($stack[$i])) {
                  $dir = dir($stack[$i]);
                  if ($dir) {
                      while (($entry = $dir->read()) !== false) {
                          if ($entry === '.' || $entry === '..') {
                              continue;
                          }
                          $add = $stack[$i] . $entry;
  
                          if (is_dir($stack[$i] . $entry)) {
                              $add = Folder::slashTerm($add);
                          }
                          $stack[] = $add;
                      }
                      $dir->close();
                  }
              }
              $j = count($stack);
          }
  
          return $size;
      }
code_tokens: public function dirsize ( ) { $ size = 0 ; $ directory = Folder :: slashTerm ( $ this -> path ) ; $ stack = [ $ directory ] ; $ count = count ( $ stack ) ; for ( $ i = 0 , $ j = $ count ; $ i < $ j ; $ i ++ ) { if ( is_file ( $ stack [ $ i ] ) ) { $ size += filesize ( $ stack [ $ i ] ) ; } elseif ( is_dir ( $ stack [ $ i ] ) ) { $ dir = dir ( $ stack [ $ i ] ) ; if ( $ dir ) { while ( ( $ entry = $ dir -> read ( ) ) !== false ) { if ( $ entry === '.' || $ entry === '..' ) { continue ; } $ add = $ stack [ $ i ] . $ entry ; if ( is_dir ( $ stack [ $ i ] . $ entry ) ) { $ add = Folder :: slashTerm ( $ add ) ; } $ stack [ ] = $ add ; } $ dir -> close ( ) ; } } $ j = count ( $ stack ) ; } return $ size ; }
docstring: Returns the size in bytes of this Folder and its contents.
  
  @return int size in bytes of current folder
docstring_tokens: Returns the size in bytes of this Folder and its contents .