Skip to content

Fix the parse error in the single-quoted string example - #3785

Merged
lacatoire merged 1 commit into
php:masterfrom
RaphaelFakhri:fix/string-single-quote-example
Nov 5, 2026
Merged

lacatoire merged 1 commit into
php:masterfrom
RaphaelFakhri:fix/string-single-quote-example

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

The "Variantes de syntaxe" example in language/types/string.xml contains an unescaped apostrophe in a single-quoted string (car c'est). PHP stops with a parse error, so readers who copy the example get no output. The English example parses without errors.

Changes

  • Escape the apostrophe: car c\'est.
  • Fix the // Affiche : comment of the last line. PHP prints $s'étendent, not $s\'étendent.

The EN-Revision stays the same, because this change does not sync anything from doc-en.

Verification

  • php -l on the extracted example: parse error before, No syntax errors detected after. Running the example prints exactly what each // Affiche : comment says.
  • php doc-base/scripts/translation/check-structure.php --lang=fr: checked=1 divergent=0.
  • php doc-base/configure.php --with-lang=fr: All good.
  • node .github/scripts/check-style-fr.mjs and git diff --check: clean.

Fixes #3784

@lacatoire

Copy link
Copy Markdown
Member

Well done @RaphaelFakhri

@lacatoire
lacatoire merged commit 34e3eb0 into php:master Nov 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Translation] Parse error in the single-quoted string example of language/types/string.xml

2 participants