classes/phing/filters/StripPhpComments.php
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;
    }
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;
    }
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 ; }
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
Returns the stream without Php comments .