Skip to content

Preserve literal dollar signs in PHP output - #930

Open
xiehuanyi wants to merge 1 commit into
andialbrecht:masterfrom
xiehuanyi:fix-php-literal-dollar-signs
Open

xiehuanyi wants to merge 1 commit into
andialbrecht:masterfrom
xiehuanyi:fix-php-literal-dollar-signs

Conversation

@xiehuanyi

Copy link
Copy Markdown

PHP output wraps SQL tokens in double-quoted strings but leaves literal $ characters unescaped. SQL text such as SELECT '$name' or PostgreSQL dollar-quoted strings is therefore interpreted as PHP variable interpolation instead of retaining its original value. PHP string rules require \$ for a literal dollar sign.

Escape dollars after the existing backslash/quote escaping. Regression tests cover SQL string literals, dollar quoting, identifiers, comments and an existing backslash before a dollar. The generated PHP assignment variable remains unchanged.

Validation: all five regressions fail before the fix. The full suite passes after it (511 passed, 2 expected failures, 1 existing unexpected pass); Ruff passes.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 11:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants