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

From: Date: Wed, 11 Nov 2026 20:45:10 +0000
Subject: [php-src] master: Merge branch 'PHP-8.5' into PHP-8.6
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-143602@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-11-11T21:44:15+01:00 Commit: https://github.com/php/php-src/commit/62cec66b3c35b462998bb909df9c9b1e9b9bd575 Raw diff: https://github.com/php/php-src/commit/62cec66b3c35b462998bb909df9c9b1e9b9bd575.diff Merge branch 'PHP-8.5' into PHP-8.6 * PHP-8.5: 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 NEWS M Zend/zend_execute_API.c Diff: diff --git a/NEWS b/NEWS index d1260936dd33..78a77bd35ae5 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,8 @@ PHP NEWS messages, the error log, and HTML and XML-RPC error output. (Jorg Sowa) . Fixed AST printing dropping readonly on promoted constructor parameters. (Jorg Sowa) + . Fixed bug GH-25311 (Assertion ret == SUCCESS in array_map()/array_filter() + after delayed out-of-memory). (ndossche) - Curl: . Fixed curl_reset() retaining CURLOPT_PRIVATE after reset. (lacatoire) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 2c361bb49509..aa6b4db7f3b0 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -847,9 +847,11 @@ 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; + if (!EG(exception)) { + return FAILURE; + } } 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 (#143602) next »