Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5e06b3c
Updated to version 2026.5 (2026e)
derickr Sep 30, 2026
972c1c3
Merge branch 'PHP-8.4' into PHP-8.5
derickr Sep 30, 2026
c3025ee
Merge branch 'PHP-8.5' into PHP-8.6
derickr Sep 30, 2026
0026387
Merge branch 'PHP-8.6'
derickr Sep 30, 2026
2116084
Fix GH-24006: Skip gh18431.phpt when libzip lacks progress callbacks …
lazerg Sep 30, 2026
e97d5f6
Merge branch 'PHP-8.4' into PHP-8.5
LamentXU123 Sep 30, 2026
783c93a
Merge branch 'PHP-8.5'
LamentXU123 Sep 30, 2026
0b31083
Merge branch 'PHP-8.6'
LamentXU123 Sep 30, 2026
0198078
Excludes `.git` from `run-tests.php .` (#23542)
NickSdot Sep 30, 2026
021acbe
sapi/cli: Fix built-in server truncating responses after a partial write
iliaal Sep 24, 2026
06f4640
zend_hrtime: use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW (#23790)
nicolas-grekas Sep 30, 2026
d2f40b9
Merge branch 'PHP-8.6'
TimWolla Sep 30, 2026
1efdcc6
Merge branch 'PHP-8.4' into PHP-8.5
iliaal Sep 30, 2026
31db39c
Merge branch 'PHP-8.5' into PHP-8.6
iliaal Sep 30, 2026
6507d8b
Merge branch 'PHP-8.6'
iliaal Sep 30, 2026
11690db
ext/pdo: Drop the previous result when execute() fails
iliaal Sep 26, 2026
be4e9ee
Merge branch 'PHP-8.4' into PHP-8.5
iliaal Sep 30, 2026
40a8468
Fix array_map optimization with non-literal function or non-literal a…
arnaud-lb Sep 30, 2026
111e785
Merge branch 'PHP-8.6'
arnaud-lb Sep 30, 2026
e16872c
Update IR (#24013)
arnaud-lb Sep 30, 2026
e2710a2
Merge branch 'PHP-8.6'
arnaud-lb Sep 30, 2026
1b81b8c
Merge branch 'PHP-8.5' into PHP-8.6
iliaal Sep 30, 2026
c91bf47
Merge branch 'PHP-8.6'
iliaal Sep 30, 2026
e5934f4
Fix GH-22051: report errors from SQLite3Result reset and finalize
iliaal Jun 17, 2026
08a49a9
Fix HashTable UAF when rebound from a parameter __toString()
iliaal Aug 13, 2026
9c20c86
Merge branch 'PHP-8.4' into PHP-8.5
iliaal Sep 30, 2026
f5c6677
Merge branch 'PHP-8.5' into PHP-8.6
iliaal Sep 30, 2026
cb28aa0
Merge branch 'PHP-8.6'
iliaal Sep 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/download-bundled/jit-ir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd "$(dirname "$0")/../../.."
tmp_dir=/tmp/php-src-download-bundled/jit-ir
rm -rf "$tmp_dir"

revision=00bec1ca490b8bc51f636a42040c5e9f64c1a91b
revision=93f92f5b5a49a02295685e340ebb0b83562cbe79

git clone --depth 1 --revision="$revision" https://github.com/dstogov/ir.git "$tmp_dir"

Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ PHP NEWS
- SQLite:
. Fixed a crash when SQLite3::close() is called from a userland callback.
(Ilia Alshanetsky)
. Fixed bug GH-22051 (Inconsistent error reporting in SQLite3Result::reset()
and SQLite3Result::finalize()). (Ilia Alshanetsky)

- Standard:
. Fixed bug #60110 (fclose(), file_put_contents(), copy() do not return false
Expand Down
94 changes: 90 additions & 4 deletions Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -5335,11 +5335,64 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg
return FAILURE;
}

/* Bail out if callback is not a first class callable */
zend_ast *callback = args->child[0];
if (callback->kind != ZEND_AST_CALL && callback->kind != ZEND_AST_STATIC_CALL) {
return FAILURE;
}

zend_ast *args_ast = zend_ast_call_get_args(callback);
if (args_ast->kind != ZEND_AST_CALLABLE_CONVERT) {
return FAILURE;
}

/* PFAs with non-literal pre-bound arguments are not optimizable because we
* can't memoize arguments without breaking pass-by-reference.
* TODO: Support PFAs when the function is known to not receive by ref. */
zend_ast_fcc *fcc = (zend_ast_fcc*)args_ast;
zend_ast_list *fcc_args = zend_ast_get_list(fcc->args);
for (uint32_t i = 0; i < fcc_args->children; i++) {
zend_ast *arg = fcc_args->child[i];
if (arg->kind == ZEND_AST_NAMED_ARG) {
arg = arg->child[1];
}

if (arg->kind == ZEND_AST_PLACEHOLDER_ARG) {
continue;
}

if (arg->kind != ZEND_AST_ZVAL) {
return FAILURE;
}
}

/* Evaluate class name */
znode class_node;
if (callback->kind == ZEND_AST_STATIC_CALL) {
znode result;
zend_compile_expr(&result, callback->child[0]);
if (result.op_type == IS_CONST || result.op_type == IS_TMP_VAR) {
class_node = result;
} else {
class_node = result;
zend_emit_op_tmp(&class_node, ZEND_QM_ASSIGN, &result, NULL);
}
} else {
class_node.op_type = IS_UNUSED;
}

/* Evaluate function name */
znode func_node;
{
znode result;
zend_compile_expr(&result, callback->child[callback->kind == ZEND_AST_CALL ? 0 : 1]);
if (result.op_type == IS_CONST || result.op_type == IS_TMP_VAR) {
func_node = result;
} else {
zend_emit_op_tmp(&func_node, ZEND_QM_ASSIGN, &result, NULL);
}
}

znode value;
value.op_type = IS_TMP_VAR;
value.u.op.var = get_temporary_variable();
Expand All @@ -5348,6 +5401,12 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg
zend_ast_create_znode(&value));
if (!call_args) {
CG(active_op_array)->T--;
if (func_node.op_type == IS_CONST) {
zval_ptr_dtor_nogc(&func_node.u.constant);
}
if (class_node.op_type == IS_CONST) {
zval_ptr_dtor_nogc(&class_node.u.constant);
}
/* The callback is not a FCC/PFA, or is not optimizable */
return FAILURE;
}
Expand Down Expand Up @@ -5387,14 +5446,35 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg

/* loop body */
znode call_result;
zend_ast *func_ast;
if (func_node.op_type == IS_CONST) {
func_ast = zend_ast_create_znode(&func_node);
} else {
znode copy_node;
zend_emit_op_tmp(&copy_node, ZEND_COPY_TMP, &func_node, NULL);
func_ast = zend_ast_create_znode(&copy_node);
}
switch (callback->kind) {
case ZEND_AST_CALL:
zend_compile_expr(&call_result, zend_ast_create(ZEND_AST_CALL, callback->child[0], call_args));
case ZEND_AST_CALL: {
zend_compile_expr(&call_result, zend_ast_create(ZEND_AST_CALL, func_ast, call_args));
break;
case ZEND_AST_STATIC_CALL:
zend_compile_expr(&call_result, zend_ast_create(ZEND_AST_STATIC_CALL, callback->child[0], callback->child[1], call_args));
}
case ZEND_AST_STATIC_CALL: {
zend_ast *class_ast;
if (class_node.op_type == IS_CONST) {
class_ast = zend_ast_create_znode(&class_node);
} else {
znode copy_node;
zend_emit_op_tmp(&copy_node, ZEND_COPY_TMP, &class_node, NULL);
class_ast = zend_ast_create_znode(&copy_node);
}

zend_compile_expr(&call_result, zend_ast_create(ZEND_AST_STATIC_CALL, class_ast, func_ast, call_args));
zend_ast_destroy(class_ast);
break;
}
}
zend_ast_destroy(func_ast);
opline = zend_emit_op(NULL, ZEND_ADD_ARRAY_ELEMENT, &call_result, &key);
SET_NODE(opline->result, result);
/* end loop body */
Expand All @@ -5409,6 +5489,12 @@ static zend_result zend_compile_func_array_map(znode *result, zend_ast_list *arg

zend_end_loop(opnum_fetch, &reset_node);
zend_emit_op(NULL, ZEND_FE_FREE, &reset_node, NULL);
if (func_node.op_type != IS_CONST) {
zend_emit_op(NULL, ZEND_FREE, &func_node, NULL);
}
if (class_node.op_type != IS_UNUSED && class_node.op_type != IS_CONST) {
zend_emit_op(NULL, ZEND_FREE, &class_node, NULL);
}

return SUCCESS;
}
Expand Down
11 changes: 2 additions & 9 deletions Zend/zend_hrtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,12 @@ void zend_startup_hrtime(void)

struct timespec ts;

#ifdef CLOCK_MONOTONIC_RAW
if (EXPECTED(0 == clock_gettime(CLOCK_MONOTONIC_RAW, &ts))) {
zend_hrtime_posix_clock_id = CLOCK_MONOTONIC_RAW;
return;
}
#endif

if (EXPECTED(0 == clock_gettime(zend_hrtime_posix_clock_id, &ts))) {
if (EXPECTED(0 == clock_gettime(CLOCK_MONOTONIC, &ts))) {
return;
}

// zend_error mechanism is not initialized at that point
fprintf(stderr, "No working CLOCK_MONOTONIC* found, this should never happen\n");
fprintf(stderr, "No working CLOCK_MONOTONIC found, this should never happen\n");
abort();

#endif
Expand Down
3 changes: 2 additions & 1 deletion Zend/zend_hrtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ZEND_API extern mach_timebase_info_data_t zend_hrtime_timerlib_info;

#elif ZEND_HRTIME_PLATFORM_POSIX

/* Not read anymore, kept for ABI compatibility */
ZEND_API extern clockid_t zend_hrtime_posix_clock_id;

#endif
Expand All @@ -94,7 +95,7 @@ static zend_always_inline zend_hrtime_t zend_hrtime(void)
return (zend_hrtime_t)mach_absolute_time() * zend_hrtime_timerlib_info.numer / zend_hrtime_timerlib_info.denom;
#elif ZEND_HRTIME_PLATFORM_POSIX
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0 };
clock_gettime(zend_hrtime_posix_clock_id, &ts);
clock_gettime(CLOCK_MONOTONIC, &ts);
return ((zend_hrtime_t) ts.tv_sec * (zend_hrtime_t)ZEND_NANO_IN_SEC) + ts.tv_nsec;
#elif ZEND_HRTIME_PLATFORM_HPUX
return (zend_hrtime_t) gethrtime();
Expand Down
Loading