1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/standard/tests/mail/gh20776.phpt
2025-12-25 19:42:31 +01:00

16 lines
390 B
PHP

--TEST--
GH-20776: mail() memory leak when header array contains numeric keys
--FILE--
<?php
$to = "user@example.com";
$subject = $message = "";
try {
var_dump(mail($to, $subject, $message, ['RandomHeader' => 'Value', 5 => 'invalid key']));
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
TypeError: Header name cannot be numeric, 5 given