Skip to content

[%pS migration] Use %pS in Zend/* - #23142

Merged
DanielEScherzer merged 24 commits into
php:PHP-8.6from
DanielEScherzer:ps-migration-zend
Oct 30, 2026
Merged

DanielEScherzer merged 24 commits into
php:PHP-8.6from
DanielEScherzer:ps-migration-zend

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

No description provided.

@DanielEScherzer

DanielEScherzer commented Aug 8, 2026 •

Copy link
Copy Markdown
Member Author

This is going to fix a bunch of null byte truncations that I haven't yet reported, basically every place a class entry name is accessed ZSTR_VAL was going to truncate anonymous class names
Is it worth creating a bug fix for the previous branches?

Also, on CircleCI it seems that the anonymous class names have different ending ($0 vs $1) - any ideas why? Edit: used %x instead

Looks like I also need to address the JIT versions of the errors Edit: done

@DanielEScherzer DanielEScherzer changed the title [%pS specifier migration] Use %pS in messages in Zend/* [%pS migration] Use %pS in Zend/* Aug 8, 2026
@DanielEScherzer
DanielEScherzer marked this pull request as ready for review August 8, 2026 20:23
Comment thread Zend/zend_API.c Resolved
@NattyNarwhal

Copy link
Copy Markdown
Member

Making a follow-up PR to remove the unchecked versions after?

@Girgias Girgias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm very much not a fan of blanket changes, especially as in many cases this is not fixing anything.

@DanielEScherzer

Copy link
Copy Markdown
Member Author

I'm very much not a fan of blanket changes, especially as in many cases this is not fixing anything.

Even when this isn't fixing something, it does have a performance improvement of not needing to call strlen to figure out the length of the string to copy

The tests show that this is fixing things in a few places

I intentionally split this up per-file so that if there are places that you don't object to, I can split those out into a separate PR and we can merge those while discussing the rest

Comment thread ext/date/tests/bug65672.phpt Resolved
@DanielEScherzer
DanielEScherzer changed the base branch from master to PHP-8.6 October 3, 2026 19:11
@DanielEScherzer

Copy link
Copy Markdown
Member Author

Macos failure is unrelated, #24686

@DanielEScherzer
DanielEScherzer force-pushed the ps-migration-zend branch 2 times, most recently from 7eeecd9 to 6084818 Compare October 30, 2026 00:12
@DanielEScherzer

Copy link
Copy Markdown
Member Author

Turns out the rebase wasn't fully up to date, rebased again, will merge once CI passes

In addition to the fixes within the zend_execute.c file, support for error
strings with null bytes was added to `zend_type_error()`.

Also update the ext/opcache helpers to match
@DanielEScherzer
DanielEScherzer merged commit e2fa0c9 into php:PHP-8.6 Oct 30, 2026
2 of 3 checks passed
@DanielEScherzer
DanielEScherzer deleted the ps-migration-zend branch October 30, 2026 01:22
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.

5 participants