Returns the  stream without Php comments.

@param  null $len
@return string the resulting stream, or -1
if the end of the resulting stream has been reached
974151
public function read($len = null)
    {
        $buffer = $this->in->read($len);
        if ($buffer === -1) {
            return -1;
        }
        $newStr = '';
        $tokens = token_get_all($buffer);

        foreach ($tokens as $token) {
            if (is_array($token)) {
                list($id, $text) = $token;

                switch ($id) {
                    case T_COMMENT:
                    case T_DOC_COMMENT:
                        // no action on comments
                        continue 2;

                    default:
                        $newStr .= $text;
                        continue 2;
                }
            }
            $newStr .= $token;
        }

        return $newStr;
    }
458585
function random($len)
    {
        $len     = abs($len);
        $pool    = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
        $poolLen = strlen($pool);
        $str     = '';
        while ($len-- > 0)
            $str .= substr($pool, rand(0, $poolLen), 1);

        return $str;
    }
999797
public function length()
    {
        $length = 0;

        foreach ($this->_streams as $stream) {
            $len = $stream->length();
            if ($len === null) {
                return;
            }
            $length += $len;
        }
        return $length;
    }
875387
public function output(Int $length = 4096) : String
    {
        $stream = $this->stream;

        stream_set_blocking($stream, true);

        $data = "";

        while( $buffer = fread($stream, $length) )
        {
            $data .= $buffer;
        }

        fclose($stream);

        return $data;
    }
1230375
public function read($len)
    {
        $null = null;
        $read = array($this->handle_);
        $readable = @stream_select(
            $read,
            $null,
            $null,
            $this->recvTimeoutSec_,
            $this->recvTimeoutUsec_
        );

        if ($readable > 0) {
            $data = fread($this->handle_, $len);
            if ($data === false) {
                throw new TTransportException('TSocket: Could not read ' . $len . ' bytes from ' .
                    $this->host_ . ':' . $this->port_);
            } elseif ($data == '' && feof($this->handle_)) {
                throw new TTransportException('TSocket read 0 bytes');
            }

            return $data;
        } elseif ($readable === 0) {
            throw new TTransportException('TSocket: timed out reading ' . $len . ' bytes from ' .
                $this->host_ . ':' . $this->port_);
        } else {
            throw new TTransportException('TSocket: Could not read ' . $len . ' bytes from ' .
                $this->host_ . ':' . $this->port_);
        }
    }
402472
public function readline($length=null) {
		$this->assertReadable();
		return $this->format->readline($this->file, $length);
	}
1124344
public function generateRandomString($len = 32) {
		$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		$max = strlen($chars) - 1;

		$strArr = [];
		for($i = 0; $i < $len; $i++) {
			$strArr[] = $chars[mt_rand(0, $max)];
		}

		return implode($strArr);
	}
479983
public function randomStr($len = 20, $ignore = null)
    {
        $source = 'abcdefghikjlmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
        if (!is_null($ignore)) {
            $tmp = array();
            for ($i = 0; $i < strlen($ignore); ++$i) {
                $tmp[] = $ignore[$i];
            }
            $source = str_replace($tmp, '', $source);
        }
        $len = abs(intval($len));
        $n = strlen($source) - 1;
        $ret = '';
        for ($i = 0; $i < $len; ++$i) {
            $ret .= $source[rand(0, $n)];
        }

        return $ret;
    }
562163
public static function getRand($len = 12, $onlyNum = false)
    {
        $chars = $onlyNum ? '0123456789' : 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        mt_srand((double)microtime() * 1000000 * getmypid());
        $return = '';
        while(strlen($return) < $len){
            $return .= substr($chars, (mt_rand() % strlen($chars)), 1);
        }

        return $return;
    }
392719
private function getStream(int $cursor = null, int $length = null) : string
    {
        if ($cursor === null) {
            $cursor = $this->cursor;
        }

        // If the cached length isn't the same or if the cursor has actually gone backwards, use the original input
        if ($this->streamCache['length'] !== $length || $this->streamCache['cursor'] > $cursor) {
            $this->streamCache['cursor'] = $cursor;
            $this->streamCache['length'] = $length;

            if ($length === null) {
                $this->streamCache['stream'] = substr($this->input, $cursor);
            } else {
                $this->streamCache['stream'] = substr($this->input, $cursor, $length);
            }
        } elseif ($this->streamCache['length'] === $length && $this->streamCache['cursor'] !== $cursor) {
            // Grab the substring from the cached stream
            $cursorDifference = $cursor - $this->streamCache['cursor'];

            if ($length === null) {
                $this->streamCache['stream'] = substr($this->streamCache['stream'], $cursorDifference);
            } else {
                $this->streamCache['stream'] = substr($this->streamCache['stream'], $cursorDifference, $length);
            }

            $this->streamCache['cursor'] = $cursor;
        }

        return $this->streamCache['stream'];
    }
1251119
public function getReadBufferAsync(&$length): \Generator
    {
        $buffer = yield $this->stream->getReadBuffer($l);
        $length = ord(yield $buffer->bufferRead(1));
        if ($length >= 127) {
            $length = unpack('V', (yield $buffer->bufferRead(3))."\0")[1];
        }
        $length <<= 2;

        return $buffer;
    }
214880
public function read(int $length = null): string
    {
        // can not call fgets with null when not specified
        $data = null === $length ? fgets($this->resource) : fgets($this->resource, $length);
        if (false === $data) {
            // fgets() returns false on eof while feof() returned false before
            // but will now return true
            if ($this->eof()) {
                return '';
            }

            if (stream_get_meta_data($this->resource)['timed_out']) {
                throw new Timeout(
                        'Reading of ' . $length . ' bytes failed: timeout of '
                        . $this->timeout . ' seconds exceeded'
                );
            }

            throw new ConnectionFailure(
                    'Reading of ' . $length . ' bytes failed.'
            );
        }

        return $data;
    }
165790
public function stream_read($count) {
		if ($this->_lob->eof() || !$count) {
			return '';
		}

		// CLOB to return characters not bytes
		return $this->_lob->read($count / 2); // Fix we expect 2 byte char
	}
354776
function read($inByte = null)
    {
        if ($this->getSegmentLimit() == -1)
            return $this->_t__wrap_stream->read($inByte);


        $inByte = ($inByte === null)
            ? (
                ($this->getBuffer() === null) ? $this->getSize() : $this->getBuffer()

            ) : $inByte;

        $remain = $this->getSegmentLimit() - $this->getCurrOffset();
        if ($remain > 0)
            return $this->_t__wrap_stream->read(min($remain, $inByte));

        return '';
    }
712365
public function getEncodedStream()
    {
        if (!$this->_isStream) {
            // require_once 'Zend/Mime/Exception.php';
            throw new Zend_Mime_Exception('Attempt to get a stream from a string part');
        }

        //stream_filter_remove(); // ??? is that right?
        switch ($this->encoding) {
            case Zend_Mime::ENCODING_QUOTEDPRINTABLE:
                $filter = stream_filter_append(
                    $this->_content,
                    'convert.quoted-printable-encode',
                    STREAM_FILTER_READ,
                    array(
                        'line-length'      => 76,
                        'line-break-chars' => Zend_Mime::LINEEND
                    )
                );
                if (!is_resource($filter)) {
                    // require_once 'Zend/Mime/Exception.php';
                    throw new Zend_Mime_Exception('Failed to append quoted-printable filter');
                }
                break;
            case Zend_Mime::ENCODING_BASE64:
                $filter = stream_filter_append(
                    $this->_content,
                    'convert.base64-encode',
                    STREAM_FILTER_READ,
                    array(
                        'line-length'      => 76,
                        'line-break-chars' => Zend_Mime::LINEEND
                    )
                );
                if (!is_resource($filter)) {
                    // require_once 'Zend/Mime/Exception.php';
                    throw new Zend_Mime_Exception('Failed to append base64 filter');
                }
                break;
            default:
        }
        return $this->_content;
    }
838131
public function read($length)
    {
        $buffer = '';
        $total = count($this->streams) - 1;
        $remaining = $length;

        while ($remaining > 0) {
            // Progress to the next stream if needed.
            if ($this->streams[$this->current]->eof()) {
                if ($this->current == $total) {
                    break;
                }
                $this->current++;
            }
            $buffer .= $this->streams[$this->current]->read($remaining);
            $remaining = $length - strlen($buffer);
        }

        $this->pos += strlen($buffer);

        return $buffer;
    }
696487
public static function random($len = 6)
    {
        $chars  = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $random = '';
        for ($p = 0; $p < $len; $p++) {
            $random .= $chars[mt_rand(0, 61)];
        }

        return $random;
    }