8000 zend_compile: Optimize `sprintf()` into a rope by TimWolla · Pull Request #14546 · php/php-src · GitHub
[go: up one dir, main page]

Skip to content
8000

zend_compile: Optimize sprintf() into a rope #14546

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 7 commits into from
Jun 13, 2024
Prev Previous commit
Next Next commit
zend_compile: Add additional explanatory comments to zend_compile_fun…
…c_sprintf()
  • Loading branch information
TimWolla committed Jun 13, 2024
commit 490f2006e7a69e1353c0896e471e6ca76dfa56ae
2 changes: 2 additions & 0 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4718,11 +4718,13 @@ static void zend_compile_rope_finalize(znode *result, uint32_t j, zend_op *init_

static zend_result zend_compile_func_sprintf(znode *result, zend_ast_list *args) /* {{{ */
{
/* Bail out if we do not have a format string. */
if (args->children < 1) {
return FAILURE;
}

zend_eval_const_expr(&args->child[0]);
/* Bail out if the format string is not constant. */
if (args->child[0]->kind != ZEND_AST_ZVAL) {
return FAILURE;
}
Expand Down
0