MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / php_unescape_single_quoted

Function php_unescape_single_quoted

build.rs:637–641  ·  view source on GitHub ↗

Unescape a PHP single-quoted string value. PHP single-quoted strings only recognise two escape sequences: - `\\` → `\` - `\'` → `'`

(s: &str)

Source from the content-addressed store, hash-verified

635/// - `\\` → `\`
636/// - `\'` → `'`
637fn php_unescape_single_quoted(s: &str) -> String {
638 s.replace("\\\\", "\x00")
639 .replace("\\'", "'")
640 .replace('\x00', "\\")
641}
642
643/// Escape a string for embedding in a Rust string literal.
644fn escape(s: &str) -> String {

Callers 1

parse_map_entryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected