-
Notifications
You must be signed in to change notification settings - Fork 7.9k
sapi/phpdbg: Use HASH_FOREACH macro #16211
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
Conversation
|
||
zend_hash_internal_pointer_reset_ex(Z_ARRVAL(zbacktrace), &position); | ||
line = zend_get_executed_lineno(); | ||
file = zend_get_executed_filename_ex(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike zend_get_executed_filename
, this can return NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why that is a problem? file
is always guarded by a NULL
check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, nvm
sapi/phpdbg/phpdbg_frame.c
Outdated
i++; | ||
} else { | ||
phpdbg_out(" => "); | ||
phpdbg_dump_prototype(tmp); | ||
phpdbg_out(" (internal function)\n"); | ||
} | ||
|
||
file = zend_hash_find(Z_ARRVAL_P(tmp), ZSTR_KNOWN(ZEND_STR_FILE)); | ||
line = zend_hash_find(Z_ARRVAL_P(tmp), ZSTR_KNOWN(ZEND_STR_LINE)); | ||
zval *file_zv = zend_hash_find(Z_ARRVAL_P(tmp), ZSTR_KNOWN(ZEND_STR_FILE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just change this to
file = zend_hash_find_ptr(Z_ARRVAL_P(tmp), ZSTR_KNOWN(ZEND_STR_FILE));
and remove the if-else part.
That makes the code less noisy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI green
|
||
zend_hash_internal_pointer_reset_ex(Z_ARRVAL(zbacktrace), &position); | ||
line = zend_get_executed_lineno(); | ||
file = zend_get_executed_filename_ex(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, nvm
No description provided.