Category
stdlib · php-src-strict · IMAP side-load / PROFILE≥8.4 (or PHP_COMPILER_ENABLE_IMAP=1)
Problem
When IMAP is advertised (extension_loaded('imap') true under PHP_COMPILER_PROFILE=8.4+, or with PHP_COMPILER_ENABLE_IMAP=1), imap_open / imap_close / … register, but imap_timeout() and the IMAP_OPENTIMEOUT / IMAP_READTIMEOUT / IMAP_WRITETIMEOUT / IMAP_CLOSETIMEOUT constants are absent. php-src ships imap_timeout(int $timeout_type, int $timeout = -1): int|bool for get/set of c-client timeouts. ext/imap/Module.php only lists eight procedural APIs.
| Repro |
Zend 8.3+ (ext/imap) |
VM (2026-08-04, IMAP advertised) |
function_exists('imap_timeout') |
true |
false |
defined('IMAP_OPENTIMEOUT') (and READ/WRITE/CLOSE) |
true |
false |
imap_timeout(IMAP_OPENTIMEOUT) |
int (current) |
Error: Call to undefined function |
php-src reference
Note: core php-src unbundled imap after 8.3; PHP-8.3 / PECL stub remains the reference for in-tree ext/imap. Sibling gap: #27674 (imap_is_open).
PHP implementation target
ext/imap/imap_timeout.php — new Internal (process-wide timeout table is fine for v1 local-mbox)
ext/imap/Module.php — register + define IMAP_*TIMEOUT when ImapExtensionPolicy::advertisesBuiltins()
- Prefer PHP-in-PHP; JIT may stay VM-only like other imap_* v1 helpers
Repro
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_ENABLE_IMAP=1 PHP_COMPILER_PROFILE=8.3 php bin/vm.php -r "
echo function_exists(\"imap_timeout\") ? \"Y\" : \"N\", PHP_EOL;
echo defined(\"IMAP_OPENTIMEOUT\") ? \"Y\" : \"N\", PHP_EOL;
"'
Done when
Category
stdlib· php-src-strict · IMAP side-load / PROFILE≥8.4 (orPHP_COMPILER_ENABLE_IMAP=1)Problem
When IMAP is advertised (
extension_loaded('imap')true underPHP_COMPILER_PROFILE=8.4+, or withPHP_COMPILER_ENABLE_IMAP=1),imap_open/imap_close/ … register, butimap_timeout()and theIMAP_OPENTIMEOUT/IMAP_READTIMEOUT/IMAP_WRITETIMEOUT/IMAP_CLOSETIMEOUTconstants are absent. php-src shipsimap_timeout(int $timeout_type, int $timeout = -1): int|boolfor get/set of c-client timeouts.ext/imap/Module.phponly lists eight procedural APIs.function_exists('imap_timeout')truefalsedefined('IMAP_OPENTIMEOUT')(and READ/WRITE/CLOSE)truefalseimap_timeout(IMAP_OPENTIMEOUT)Error: Call to undefined functionphp-src reference
ext/imap/php_imap.stub.php—imap_timeout,IMAP_*TIMEOUText/imap/php_imap.c—PHP_FUNCTION(imap_timeout)Note: core php-src unbundled imap after 8.3; PHP-8.3 / PECL stub remains the reference for in-tree
ext/imap. Sibling gap: #27674 (imap_is_open).PHP implementation target
ext/imap/imap_timeout.php— newInternal(process-wide timeout table is fine for v1 local-mbox)ext/imap/Module.php— register + defineIMAP_*TIMEOUTwhenImapExtensionPolicy::advertisesBuiltins()Repro
Done when
function_exists('imap_timeout')andIMAP_*TIMEOUTdefined when IMAP advertised$timeout = -1get).phptundertest/compliance/cases/with IMAP enabled