Minor refactorings to zend_exceptions() - #16684
Merged
Merged
Conversation
ndossche
reviewed
Nov 2, 2024
ndossche
left a comment
Member
There was a problem hiding this comment.
Looks mostly good, only some remark about comments
| if (file) { | ||
| if (Z_TYPE_P(file) != IS_STRING) { | ||
| if (UNEXPECTED(Z_TYPE_P(file) != IS_STRING)) { | ||
| /* This is a typed property and can only happen if modified via ArrayObject */ |
Member
There was a problem hiding this comment.
This is not true, see bug63762.phpt in Zend
| if (EXPECTED(Z_TYPE_P(tmp) == IS_LONG)) { | ||
| line = Z_LVAL_P(tmp); | ||
| } else { | ||
| /* This is a typed property and can only happen if modified via ArrayObject */ |
Member
There was a problem hiding this comment.
Likely not true as well due to similar reasons as bug63762.phpt in Zend
| ZSTR_LEN(str->s) -= 2; /* remove last ', ' */ | ||
| } | ||
| } else { | ||
| /* The trace property is typed and private */ |
Member
There was a problem hiding this comment.
Check with bug63762.phpt in Zend
ndossche
approved these changes
Nov 10, 2024
This was referenced Jul 29, 2026
DanielEScherzer
added a commit
to DanielEScherzer/php-src
that referenced
this pull request
Aug 3, 2026
In addition to the fixes within the reflection extension, support for error strings with null bytes was added to `zend_throw_error()` and `zend_throw_exception_ex()`. The changes to `zend_throw_exception_ex()` are a partial backport of php#16684.
adrian-enspired
pushed a commit
to adrian-enspired/php-src
that referenced
this pull request
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was planning on removing a bunch of
zval_get_long()andzval_get_string()calls to properties as those are typed properties, however not sure it is wise to remove them asArrayObjectcan in theory mess them up.