private function _basicCompression($script)
    {
        $parser = new ParseMaster();
        // make safe
        $parser->escapeChar = '\\';
        // protect strings
        $parser->add('/\'[^\'\\n\\r]*\'/', self::IGNORE);
        $parser->add('/"[^"\\n\\r]*"/', self::IGNORE);
        // remove comments
        $parser->add('/\\/\\/[^\\n\\r]*[\\n\\r]/', ' ');
        $parser->add('/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//', ' ');
        // protect regular expressions
        $parser->add('/\\s+(\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?)/', '$2'); // IGNORE
        $parser->add('/[^\\w\\x24\\/\'"*)\\?:]\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?/', self::IGNORE);
        // remove: ;;; doSomething();
        if ($this->_specialChars) $parser->add('/;;;[^\\n\\r]+[\\n\\r]/');
        // remove redundant semi-colons
        $parser->add('/\\(;;\\)/', self::IGNORE); // protect for (;;) loops
        $parser->add('/;+\\s*([};])/', '$2');
        // apply the above
        $script = $parser->exec($script);

        // remove white-space
        $parser->add('/(\\b|\\x24)\\s+(\\b|\\x24)/', '$2 $3');
        $parser->add('/([+\\-])\\s+([+\\-])/', '$2 $3');
        $parser->add('/\\s+/', '');
        // done
        return $parser->exec($script);
    }
private function _basicCompression($script)
    {
        $parser = new ParseMaster();
        // make safe
        $parser->escapeChar = '\\';
        // protect strings
        $parser->add('/\'[^\'\\n\\r]*\'/', self::IGNORE);
        $parser->add('/"[^"\\n\\r]*"/', self::IGNORE);
        // remove comments
        $parser->add('/\\/\\/[^\\n\\r]*[\\n\\r]/', ' ');
        $parser->add('/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//', ' ');
        // protect regular expressions
        $parser->add('/\\s+(\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?)/', '$2'); // IGNORE
        $parser->add('/[^\\w\\x24\\/\'"*)\\?:]\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?/', self::IGNORE);
        // remove: ;;; doSomething();
        if ($this->_specialChars) $parser->add('/;;;[^\\n\\r]+[\\n\\r]/');
        // remove redundant semi-colons
        $parser->add('/\\(;;\\)/', self::IGNORE); // protect for (;;) loops
        $parser->add('/;+\\s*([};])/', '$2');
        // apply the above
        $script = $parser->exec($script);

        // remove white-space
        $parser->add('/(\\b|\\x24)\\s+(\\b|\\x24)/', '$2 $3');
        $parser->add('/([+\\-])\\s+([+\\-])/', '$2 $3');
        $parser->add('/\\s+/', '');
        // done
        return $parser->exec($script);
    }
private function _basicCompression ( $ script ) { $ parser = new ParseMaster ( ) ; // make safe $ parser -> escapeChar = '\\' ; // protect strings $ parser -> add ( '/\'[^\'\\n\\r]*\'/' , self :: IGNORE ) ; $ parser -> add ( '/"[^"\\n\\r]*"/' , self :: IGNORE ) ; // remove comments $ parser -> add ( '/\\/\\/[^\\n\\r]*[\\n\\r]/' , ' ' ) ; $ parser -> add ( '/\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\//' , ' ' ) ; // protect regular expressions $ parser -> add ( '/\\s+(\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?)/' , '$2' ) ; // IGNORE $ parser -> add ( '/[^\\w\\x24\\/\'"*)\\?:]\\/[^\\/\\n\\r\\*][^\\/\\n\\r]*\\/g?i?/' , self :: IGNORE ) ; // remove: ;;; doSomething(); if ( $ this -> _specialChars ) $ parser -> add ( '/;;;[^\\n\\r]+[\\n\\r]/' ) ; // remove redundant semi-colons $ parser -> add ( '/\\(;;\\)/' , self :: IGNORE ) ; // protect for (;;) loops $ parser -> add ( '/;+\\s*([};])/' , '$2' ) ; // apply the above $ script = $ parser -> exec ( $ script ) ; // remove white-space $ parser -> add ( '/(\\b|\\x24)\\s+(\\b|\\x24)/' , '$2 $3' ) ; $ parser -> add ( '/([+\\-])\\s+([+\\-])/' , '$2 $3' ) ; $ parser -> add ( '/\\s+/' , '' ) ; // done return $ parser -> exec ( $ script ) ; }
zero encoding - just removal of white space and comments
zero encoding - just removal of white space and comments