Skip to content

Fix GH-12558 Escape \N and \n in generated stubs #12562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

kocsismate
Copy link
Member

No description provided.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this so quickly!
Minor nit for the escaping of \n: the small n does not need to be escaped
Also: doesn't this need to target 8.1 as it's a bugfix for the stub generator and may be used for PECL extensions?

@kocsismate
Copy link
Member Author

kocsismate commented Oct 30, 2023

Also: doesn't this need to target 8.1 as it's a bugfix for the stub generator and may be used for PECL extensions?

I was considering this option, but I ended up targeting only 8.3 (edit: I mistakenly used to target master) as the bug didn't seem widespread. However, since the original fix for \n was introduced in PHP 8.2, I'll also add my fix to this version as well.

We have to escape \N because of this C++23 proposal: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2071r2.html

Aha! Thanks for the explanation :)

@kocsismate kocsismate changed the base branch from master to PHP-8.2 October 30, 2023 22:47
@kocsismate kocsismate closed this Oct 30, 2023
@kocsismate kocsismate reopened this Oct 30, 2023
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Thanks!

@kocsismate kocsismate merged commit d4e40dc into php:PHP-8.2 Oct 31, 2023
@kocsismate kocsismate deleted the fix-escape-n branch October 31, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants