$s, 'isBinary' => $isBinary, 'type' => $type )); } /** * Parses escape sequences in the content of a doubly quoted string * or heredoc string. * * @param string $s String without quotes * @return string String with escape sequences parsed */ public static function parseEscapeSequences($s) { // TODO: parse hex and oct escape sequences return str_replace( array('\\\\', '\"', '\$', '\n', '\r', '\t', '\f', '\v'), array( '\\', '"', '$', "\n", "\r", "\t", "\f", "\v"), $s ); } }