You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
var_dump() and debug_zval_dump() print the full anonymous class name with a raw NUL byte #25418
Since 5ed6625 (#23143, %pS migration of ext/standard), var_dump() and debug_zval_dump() print the internal name of an anonymous class, including the NUL byte and the defining file path. PHP 8.5 printed class@anonymous.
The commit changed php_printf("...object(%s)...", ZSTR_VAL(class_name)) to %pS, which prints the whole zend_string. The private property label (zend_unmangle_property_name() + %s) and print_r() still stop at the NUL, so the same dump now shows two different names for one class. The change is in 8.6.0RC6/RC7.
The full name is a deliberate consequence of treating NUL truncation as a bug (#23142), but for dumpers it was not discussed: #23143 had no review, the change is not in NEWS or UPGRADING, and labels and print_r() were left truncated. For 8.6 I suggest restoring %s for the two object headers in ext/standard/var.c (8.5 output); printing the full name consistently in dumps could be discussed for master. @DanielEScherzer, what do you think?
I think any case where a NUL byte was implicitly causing truncation without being intended is a bug, and print_r() should be changed to show the full name, rather than reverting the others. Would that work for you @jorgsowa?
Personally I think it should be reverted, because of unforeseen side effects. I suspect many of those may be used in test assertions. And it may not be trivial to have simple workaround for such tests during RC phase.
How often do userland tests use .phpt tests rather than PHPUnit assertions that would start to fail?
For any %pS change where the output changes, I would argue that it is a bug fix, and only the ones where %pS doesn't change things and just improves performance are refactorings that warrant wider discussion and/or targeting master
PHPUnit assertions are not only ones that are used in production test suites. This should be the question to release managers if they approve such change. Honestly, I don't want to defend it, neither be against it. According to the policy such changes shouldn't be included in RC phase, and that's why I reported this case.
IMHO it's too late for 8.6. The same commit changed the __sleep() warnings of serialize(), eg "\0*\0b" is returned from __sleep() multiple times instead of "" is returned from __sleep() multiple times. Code that mirrors these warnings has to follow during the RC phase, see symfony/polyfill#728 and symfony/php-ext-deepclone#67.
To clarify, I'd revert for 8.6.0, and reapply in 8.7 rather than in 8.6.1. Code that mirrors these messages can follow such a change more easily in a minor version than in a patch one.
@nicolas-grekas Thanks for the clarification and your input.
Just thinking out loud here. If this is considered a bug and the behaviour is reverted in 8.6.1, code that implements a workaround could still target a specific range of PHP_VERSION_ID. Whoever doesn't want to deal with the workaround could then block 8.6.0 specifically in their composer.json.
Activity
jorgsowa commentedon Nov 12, 2026
I created suggested fix #25419 but feel free to apply your changes. I wanted only to point up regressions in PHP 8.6.
Girgias commentedon Nov 12, 2026
I'm in favour of just reverting for 8.6, as this change wasn't really discussed and the fact it was hidden might break quite a few assumptions?
Girgias commentedon Nov 12, 2026
Daniel said he'll respond to this later today and would like that any revert be postponed until he has time to reply.
jorgsowa commentedon Nov 12, 2026
Sure, it's not up to me to make any decisions in this matter. That's not really my area of expertise.
DanielEScherzer commentedon Nov 13, 2026
"later today" loosely defined
I think any case where a NUL byte was implicitly causing truncation without being intended is a bug, and print_r() should be changed to show the full name, rather than reverting the others. Would that work for you @jorgsowa?
jorgsowa commentedon Nov 13, 2026
Personally I think it should be reverted, because of unforeseen side effects. I suspect many of those may be used in test assertions. And it may not be trivial to have simple workaround for such tests during RC phase.
DanielEScherzer commentedon Nov 13, 2026
How often do userland tests use .phpt tests rather than PHPUnit assertions that would start to fail?
For any %pS change where the output changes, I would argue that it is a bug fix, and only the ones where %pS doesn't change things and just improves performance are refactorings that warrant wider discussion and/or targeting master
jorgsowa commentedon Nov 13, 2026
PHPUnit assertions are not only ones that are used in production test suites. This should be the question to release managers if they approve such change. Honestly, I don't want to defend it, neither be against it. According to the policy such changes shouldn't be included in RC phase, and that's why I reported this case.
DanielEScherzer commentedon Nov 13, 2026
Okay, lets ask @php/release-managers-86 for thoughts
nicolas-grekas commentedon Nov 15, 2026
IMHO it's too late for 8.6. The same commit changed the
__sleep()warnings ofserialize(), eg"\0*\0b" is returned from __sleep() multiple timesinstead of"" is returned from __sleep() multiple times. Code that mirrors these warnings has to follow during the RC phase, see symfony/polyfill#728 and symfony/php-ext-deepclone#67.Compare the __sleep() warnings with serialize() with names cut at the…
mbeccati commentedon Nov 15, 2026
I suppose it is definitely too late for 8.6.0. Is it something we can fix in 8.6.1?
bug #66 Fix GC crashes on lazy ghosts with PHP 8.4.27, 8.5.12 and 8.6…
nicolas-grekas commentedon Nov 15, 2026
Unless there's a specific reason to hurry, this has been as such since years so it can wait 8.7 I suppose?
mbeccati commentedon Nov 15, 2026
@nicolas-grekas I'm a bit confused, I thought the breaking change was introduced in PHP 8.6.0RC5.
nicolas-grekas commentedon Nov 15, 2026
By "this" I meant the truncation at the NUL byte, which has been the behavior for years. The full names are what's new, since 8.6.0RC5.
nicolas-grekas commentedon Nov 15, 2026
To clarify, I'd revert for 8.6.0, and reapply in 8.7 rather than in 8.6.1. Code that mirrors these messages can follow such a change more easily in a minor version than in a patch one.
mbeccati commentedon Nov 15, 2026
@nicolas-grekas Thanks for the clarification and your input.
Just thinking out loud here. If this is considered a bug and the behaviour is reverted in 8.6.1, code that implements a workaround could still target a specific range of
PHP_VERSION_ID. Whoever doesn't want to deal with the workaround could then block 8.6.0 specifically in theircomposer.json.mbeccati commentedon Nov 15, 2026
@nicolas-grekas Personally, I wouldn't delay PHP 8.6.0 by a whole month for this. Only security issues are allowed to go in after the last RC...
nicolas-grekas commentedon Nov 15, 2026
Definitely!