Category
stdlib
Problem
mail() is missing. Many PHP apps use it for simple outbound email (web forms, alerts). php-src implements it in ext/standard (not a separate extension).
function_exists('mail') is false under bin/vm.php (verified 2026-06-04).
Duplicate tracker: consolidate with #5092 — implement on this issue (#3285); close #5092 when merged.
php-src reference
Repro (failure today)
<?php
if (!function_exists('mail')) {
fwrite(STDERR, "MISSING: mail\n");
exit(1);
}
$ok = @mail(
'user@example.com',
'Subject',
"Body line\n",
"From: noreply@example.com\r\n"
);
var_export($ok);
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php8.2 -r "var_export(function_exists(\"mail\")); echo PHP_EOL;"
php bin/vm.php -r "var_export(function_exists(\"mail\")); echo PHP_EOL;"
php bin/vm.php repro.php
'
| Runtime |
function_exists('mail') |
repro exit |
| Zend |
true |
var_export bool (may be false without MTA) |
| VM |
false |
exit 1 MISSING: mail |
php-src-strict probes (after implementation)
- Non-string
$to / $subject → TypeError per mail.c
- Invalid additional headers →
ValueError / E_WARNING per Zend version
Scope (PHP-in-PHP)
| Path |
Work |
ext/standard/mail.php |
VM builtin; v1 delegate to host mail() when available (bootstrap), native sendmail pipe follow-up |
ext/standard/Module.php |
Register |
| Tests |
test/compliance/cases/stdlib/mail_exists.phpt (existence + arg validation subset) |
| Matrix |
script/capability-matrix.php |
No permanent mail transport logic in runtime/*.c unless thin sendmail pipe ABI is unavoidable.
Done when
Related
Category
stdlibProblem
mail()is missing. Many PHP apps use it for simple outbound email (web forms, alerts). php-src implements it inext/standard(not a separate extension).function_exists('mail')is false underbin/vm.php(verified 2026-06-04).Duplicate tracker: consolidate with #5092 — implement on this issue (#3285); close #5092 when merged.
php-src reference
ext/standard/mail.c—PHP_FUNCTION(mail),php_mail(),php_mail_build_headers()ext/standard/headers.c— additional header validationmain/php_ini.c—sendmail_path,mail.add_x_header,mail.mixed_lf_and_crlfRepro (failure today)
function_exists('mail')truevar_exportbool (may befalsewithout MTA)falseMISSING: mailphp-src-strict probes (after implementation)
$to/$subject→TypeErrorpermail.cValueError/E_WARNINGper Zend versionScope (PHP-in-PHP)
ext/standard/mail.phpmail()when available (bootstrap), native sendmail pipe follow-upext/standard/Module.phptest/compliance/cases/stdlib/mail_exists.phpt(existence + arg validation subset)script/capability-matrix.phpNo permanent mail transport logic in
runtime/*.cunless thin sendmail pipe ABI is unavoidable.Done when
function_exists('mail')true on VMMISSING: mailfatal; accepts Zend-like bool return without MTATypeErrorprobe for non-string recipient matches Zend./script/ci-fast.sh --filter mail_existsgreenRelated