Merge branch 'PHP-8.5' into PHP-8.6

* PHP-8.5:
  Fix GH-23896: Assertion failure in zend_call_function() after a throwing deprecation
This commit is contained in:
David Carlier committed 2026-09-30 05:23:23 +01:00
commit 0520bac249
3 files changed
+40 -3

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
--TEST--
GH-23896 (Assertion failure in zend_call_function() when the error handler throws during parent:: callable resolution)
--FILE--
<?php
set_error_handler(function ($severity, $m) {
throw new Exception($m, $severity);
});
spl_autoload_register(function ($class) {
if ($class === 'Loader') {
throw new Exception("Cannot load $class");
}
});
class P {}
class C extends P {
public function u(string $s) {
return unserialize($s);
}
}
foreach (['parent::my_unserialize', 'Loader::load'] as $callback) {
ini_set('unserialize_callback_func', $callback);
try {
(new C)->u('O:3:"FOO":0:{}');
} catch (Exception $e) {
echo $e->getMessage(), "\n";
var_dump($e->getPrevious());
}
}
?>
--EXPECT--
Use of "parent" in callables is deprecated
NULL
Cannot load Loader
NULL
+6
View File
@@ -848,6 +848,12 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
}
if (!zend_is_callable_ex(&fci->function_name, fci->object, 0, NULL, fci_cache, &error)) {
if (EG(exception)) {
if (error) {
efree(error);
}
return SUCCESS;
}
ZEND_ASSERT(error && "Should have error if not callable");
zend_string *callable_name
= zend_get_callable_name_ex(&fci->function_name, fci->object);
+1 -3
View File
@@ -28,14 +28,12 @@ $proc->registerPhpFunctions();
$xsl = $proc->importStylesheet($xsl);
try {
$newdom = $proc->transformToDoc($inputdom);
} catch (Error $e) {
} catch (Exception $e) {
echo $e->getMessage(), "\n";
echo $e->getPrevious()->getMessage(), "\n";
}
?>
===DONE===
--EXPECT--
string(4) "TeSt"
Invalid callback TeSt::dateLang, class "TeSt" not found
Autoload exception
===DONE===