PHP_OS - Does it contain the OS on which it was built or runs?

I searched for quite a while, but I couldn’t find a definite answer to the question that the permanent PHP_OS contains OS php that was built or launched.

The php documentation php_uname ( http://php.net/manual/de/function.php-uname.php ) reads: "For the name of the operating system only, consider using the PHP_OS constant, but keep in mind that this constant will contain the operating the system PHP was built on . "

However, on the same page there is a comment from 2006, which says: “Contrary to the last note, PHP_OS really shows that PHP is currently running PHP, [...] This has nothing to do with the system on which PHP was built . "

I could not find any specific answer anywhere on the Internet about this question (topis about php_uname and PHP_OS mainly deals only with detecting os and similar topics). What is documentation or comment right now?

The pear-core package uses PHP_OS to determine how it works on Unix-like systems or windows, so is it possible to assume that the documentation is really incorrect?

+3
source share
2 answers

I looked at the source code. The script configuration does the following:

PHP_OS=`uname | xargs`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])

main.c :

char *php_os;
php_os=PHP_OS;
REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS", php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS);

, PHP_OS PHP - , PHP_OS C, # , configure script, uname at .

, , , , .

Windows: main.c PHP_OS "WINNT", WIN32. , , , Unix Windows .

+5

PHP_OS ( PHP) PHP. PHP_WIN32 PHP_OS C ( , , this, , ).

, , , PHP.

+2

All Articles