Category
stdlib (runtime introspection)
Problem
Core runtime identity functions are missing:
phpversion(?string $extension = null): string
php_uname(string $mode = "a"): string
php_sapi_name(): string
Bootstrap and deployment scripts often gate on SAPI name or report compiler version. None are registered in ext/standard/Module.php.
php-src reference
ext/standard/info.c — PHP_FUNCTION(phpversion), PHP_FUNCTION(php_uname), PHP_FUNCTION(php_sapi_name)
main/php_version.h — PHP_VERSION
Repro
./script/docker-exec.sh -- bash -lc '
for f in phpversion php_uname php_sapi_name; do
php bin/vm.php -r "echo \$f, \"=\", function_exists(\"\$f\") ? 1 : 0, \"\\n\";"
done
'
# all 0
php -r 'echo phpversion(), "\n", php_sapi_name(), "\n";'
Scope (this repo)
| Area |
Files |
| Builtins |
ext/standard/phpversion.php, php_uname.php, php_sapi_name.php |
| Constants |
PHP_VERSION, PHP_SAPI compile-time or runtime strings in lib/Runtime.php / VM bootstrap |
| Register |
ext/standard/Module.php |
| Tests |
test/compliance/cases/stdlib/phpversion.phpt |
Done when
phpversion() returns a string identifying this compiler build (may differ from Zend — document format, e.g. phpc-0.x).
php_sapi_name() returns cli for bin/vm.php / AOT CLI entry (match Zend for same entrypoint).
php_uname('s') returns non-empty OS identifier; full 'a' mode matches Zend shape (fields documented if subset).
- All three
function_exists true on VM.
Notes
Category
stdlib(runtime introspection)Problem
Core runtime identity functions are missing:
phpversion(?string $extension = null): stringphp_uname(string $mode = "a"): stringphp_sapi_name(): stringBootstrap and deployment scripts often gate on SAPI name or report compiler version. None are registered in
ext/standard/Module.php.php-src reference
ext/standard/info.c—PHP_FUNCTION(phpversion),PHP_FUNCTION(php_uname),PHP_FUNCTION(php_sapi_name)main/php_version.h—PHP_VERSIONRepro
Scope (this repo)
ext/standard/phpversion.php,php_uname.php,php_sapi_name.phpPHP_VERSION,PHP_SAPIcompile-time or runtime strings inlib/Runtime.php/ VM bootstrapext/standard/Module.phptest/compliance/cases/stdlib/phpversion.phptDone when
phpversion()returns a string identifying this compiler build (may differ from Zend — document format, e.g.phpc-0.x).php_sapi_name()returnscliforbin/vm.php/ AOT CLI entry (match Zend for same entrypoint).php_uname('s')returns non-empty OS identifier; full'a'mode matches Zend shape (fields documented if subset).function_existstrue on VM.Notes