diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub index 9f82c9a335f..14658e20c29 100644 --- a/stubs/CoreGenericFunctions.phpstub +++ b/stubs/CoreGenericFunctions.phpstub @@ -1803,3 +1803,23 @@ function exec(string $command, &$output = null, int &$result_code = null): strin * @psalm-ignore-falsable-return */ function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {} + +/** + * @psalm-taint-sink callable $callback + */ +function forward_static_call(callable $callback, mixed ...$args): mixed {} + +/** + * @psalm-taint-sink callable $callback + */ +function forward_static_call_array(callable $callback, array $args): mixed {} + +/** + * @psalm-taint-sink callable $callback + */ +function register_shutdown_function(callable $callback, mixed ...$args): void {} + +/** + * @psalm-taint-sink callable $callback + */ +function register_tick_function(callable $callback, mixed ...$args): bool {} diff --git a/tests/TaintTest.php b/tests/TaintTest.php index 27ea0a7a134..f9f7612b3ed 100644 --- a/tests/TaintTest.php +++ b/tests/TaintTest.php @@ -2527,6 +2527,42 @@ public static function getPrevious(string $s): string { $result = $mysqli->execute_query($query);', 'error_message' => 'TaintedSql', ], + 'taintedRegisterShutdownFunction' => [ + 'code' => ' 'TaintedCallable', + ], + 'taintedRegisterTickFunction' => [ + 'code' => ' 'TaintedCallable', + ], + 'taintedForwardStaticCall' => [ + 'code' => ' 'TaintedCallable', + ], + 'taintedForwardStaticCallArray' => [ + 'code' => ' 'TaintedCallable', + ], ]; }