Category
stdlib · php-src-strict
Problem
zend_thread_id() is a PHP 8.4+ builtin. On PHP 8.2 reference profiles function_exists('zend_thread_id') is false. This compiler registers the function unconditionally (function_exists true, callable returns an int).
php-src reference
Repro
test/repro/maintainer_gap_zend_thread_id_phantom.php
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_zend_thread_id_phantom.php; echo exit:$?'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_zend_thread_id_phantom.php; echo exit:$?'
| Runtime |
Output |
| Zend 8.2 |
ok |
| VM |
fail: function_exists('zend_thread_id') true on reference profile |
Implementation hints (PHP-in-PHP)
- Gate registration on target PHP version / capability matrix (same pattern as other 8.4-only builtins)
- When enabled (8.4 profile), return OS thread id via thin POSIX/FFI helper — no permanent C builtin table growth
- Update
script/capability-matrix.php notes
Done when
Category
stdlib· php-src-strictProblem
zend_thread_id()is a PHP 8.4+ builtin. On PHP 8.2 reference profilesfunction_exists('zend_thread_id')is false. This compiler registers the function unconditionally (function_existstrue, callable returns an int).php-src reference
ext/standard/basic_functions.c—zend_thread_idregistration (PHP 8.4)Zend/zend_API.c— thread id accessorRepro
test/repro/maintainer_gap_zend_thread_id_phantom.phpokfail: function_exists('zend_thread_id') true on reference profileImplementation hints (PHP-in-PHP)
script/capability-matrix.phpnotesDone when
okon VM when reference profile is PHP 8.2function_exists/get_defined_functionsagree with php-src for active profile