src/Util/Text.php
protected static function _dump($string)
    {
        $es = ['0', 'x07', 'x08', 't', 'n', 'v', 'f', 'r'];
        $unescaped = '';
        $chars = str_split($string);
        foreach ($chars as $char) {
            if ($char === '') {
                continue;
            }
            $value = ord($char);
            if ($value >= 7 && $value <= 13) {
                $unescaped .= '\\' . $es[$value - 6];
            } elseif ($char === '"' || $char === '$' || $char === '\\') {
                $unescaped .= '\\' . $char;
            } else {
                $unescaped .= $char;
            }
        }
        return $unescaped;
    }
protected static function _dump($string)
    {
        $es = ['0', 'x07', 'x08', 't', 'n', 'v', 'f', 'r'];
        $unescaped = '';
        $chars = str_split($string);
        foreach ($chars as $char) {
            if ($char === '') {
                continue;
            }
            $value = ord($char);
            if ($value >= 7 && $value <= 13) {
                $unescaped .= '\\' . $es[$value - 6];
            } elseif ($char === '"' || $char === '$' || $char === '\\') {
                $unescaped .= '\\' . $char;
            } else {
                $unescaped .= $char;
            }
        }
        return $unescaped;
    }
protected static function _dump ( $ string ) { $ es = [ '0' , 'x07' , 'x08' , 't' , 'n' , 'v' , 'f' , 'r' ] ; $ unescaped = '' ; $ chars = str_split ( $ string ) ; foreach ( $ chars as $ char ) { if ( $ char === '' ) { continue ; } $ value = ord ( $ char ) ; if ( $ value >= 7 && $ value <= 13 ) { $ unescaped .= '\\' . $ es [ $ value - 6 ] ; } elseif ( $ char === '"' || $ char === '$' || $ char === '\\' ) { $ unescaped .= '\\' . $ char ; } else { $ unescaped .= $ char ; } } return $ unescaped ; }
Expands escape sequences and escape special chars in a string.

@param  string $string A string which contain escape sequence.
@return string         A valid double quotable string.
Expands escape sequences and escape special chars in a string .