mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The error handling is incomplete on argument cleanup. 1. The fci is not cleared which means that zend_free_trampoline() is never called. 2. The cleaning for extra named arguments was missing, resulting in memory leak. Closes GH-17219.
23 lines
473 B
PHP
23 lines
473 B
PHP
--TEST--
|
|
GH-17216 (Trampoline crash on error)
|
|
--FILE--
|
|
<?php
|
|
class TrampolineTest {
|
|
public function __call(string $name, array $arguments) {
|
|
var_dump($name, $arguments);
|
|
}
|
|
}
|
|
$o = new TrampolineTest();
|
|
$callback = [$o, 'trampoline'];
|
|
$array = ["a" => "b", 1];
|
|
try {
|
|
forward_static_call_array($callback, $array);
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECT--
|
|
Cannot use positional argument after named argument
|
|
Done
|