Surfaced by the spec contract audit (PR for spec/php).
Symptom
Per the PHP Manual on single quoted strings, inside a single-quoted PHP string the only two escape sequences are \' (literal apostrophe) and \\ (literal backslash). Both should decode to their literal characters in the extracted text.
The Okapi PHPContentFilter keeps the backslash and the apostrophe verbatim instead of decoding \' → '.
Reproduction
core/formats/phpcontent/spec.yaml feature single_quoted_string::escaped_apostrophe:
input: <?php $text = 'It\'s a test';
expected: It's a test (native, correct per PHP spec)
bridge: It\'s a test (backslash-apostrophe kept verbatim)
Spec tag
The example is tagged expected_fail: in the spec.yaml so the parity gate downgrades it to a warning until the bridge is fixed. Once the bridge fix lands, drop the expected_fail: block.
Repro test
KAPI_PARITY_SANDBOX=$PWD/.parity \
go test -tags parity -run TestParityPhpSpec/single_quoted_string -count=1 -v ./parity/...
(from cli/, on branch spec/php)
Affected upstream code
okf_phpcontent (okapi-filter-php) — the single-quoted-string lexer in PHPContentFilter, all currently-shipped Okapi versions affected.
Surfaced by the spec contract audit (PR for
spec/php).Symptom
Per the PHP Manual on single quoted strings, inside a single-quoted PHP string the only two escape sequences are
\'(literal apostrophe) and\\(literal backslash). Both should decode to their literal characters in the extracted text.The Okapi
PHPContentFilterkeeps the backslash and the apostrophe verbatim instead of decoding\'→'.Reproduction
core/formats/phpcontent/spec.yamlfeaturesingle_quoted_string::escaped_apostrophe:Spec tag
The example is tagged
expected_fail:in the spec.yaml so the parity gate downgrades it to a warning until the bridge is fixed. Once the bridge fix lands, drop theexpected_fail:block.Repro test
(from
cli/, on branchspec/php)Affected upstream code
okf_phpcontent(okapi-filter-php) — the single-quoted-string lexer inPHPContentFilter, all currently-shipped Okapi versions affected.