[php-src] master: Merge branch 'PHP-8.6'

From: Date: Wed, 11 Nov 2026 20:45:13 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143603@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-11-11T21:45:00+01:00 Commit: https://github.com/php/php-src/commit/6410d567cbc295aa3747e152755d4c8da7ac6111 Raw diff: https://github.com/php/php-src/commit/6410d567cbc295aa3747e152755d4c8da7ac6111.diff Merge branch 'PHP-8.6' * PHP-8.6: Fix GH-25311: Assertion ret == SUCCESS in array_map()/array_filter() after delayed out-of-memory Changed paths: A ext/standard/tests/array/gh25311.phpt M Zend/zend_execute_API.c Diff: diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index d8cf2d016ee8..94273a4bc59f 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -847,9 +847,9 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_ return FAILURE; /* executor is already inactive */ } if (ZEND_HAS_OOM()) { - /* Callers expect SUCCESS || EG(exception), so let's throw right now */ + /* Throws UnwindExit if the OOM is pending. If not pending, acts as if executor is inactive. */ zend_handle_delayed_oom(); - return FAILURE; + ZEND_ASSERT(EG(exception)); } if (EG(exception)) { if (fci_cache) { diff --git a/ext/standard/tests/array/gh25311.phpt b/ext/standard/tests/array/gh25311.phpt new file mode 100644 index 000000000000..c41ad6d73435 --- /dev/null +++ b/ext/standard/tests/array/gh25311.phpt @@ -0,0 +1,14 @@ +--TEST-- +GH-25311 (Assertion ret == SUCCESS in array_map()/array_filter() after delayed out-of-memory) +--INI-- +memory_limit=10M +--FILE-- +<?php + +$s = str_repeat("a", 5 * 1024 * 1024); +$s .= $s; +array_map(fn($x) => $x, [1]); + +?> +--EXPECTF-- +Fatal error: Allowed memory size of 10485760 bytes exhausted %s

« previous php.cvs (#143603) next »