get_define_vars()関数は、定義されたすべての変数で構成される配列を返します。
バージョン要件: PHP 4 >= 4.0.4、PHP 5、PHP 7
配列 get_define_vars ( void )
パラメータの説明:
空所。
環境変数、サーバー変数、ユーザー定義変数を含む、すべての定義済み変数のリストを含む多次元配列を返します。
実行結果は以下のようになります。
Array( [0] => 1 [1] => 1 [2] => 2 [3] => 3 [4] => 5 [5] => 8)Array( [0] => /tmp/543750210 /main.php)Array( [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [HOSTNAME] => glot-runner [PHPIZE_DEPS] => autoconf dpkg-dev ファイル g++ gcc libc-dev make pkg-config re2c [PHP_INI_DIR] => /usr/local/etc/php [PHP_CFLAGS] => -fstack-protector -strong -fpic -fpie -O2 [PHP_CPPFLAGS] => -fstack-protector-strong -fpic -fpie -O2 [PHP_LDFLAGS] => -Wl,-O1 -Wl,--hash-style=both -pie [GPG_KEYS] => 1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F [PHP_VERSION] => 7.2.1 [PHP_URL] => https://secure.php.net/get/php-7.2.1.tar.xz/from/this/mirror [PHP_ASC_URL] => https://secure.php.net/get/php-7.2.1.tar.xz.asc/from/this/mirror [PHP_SHA256] => 6c6cf82fda6660ed963821eb0525214bb3547e8e29f447b9c15b2d8e6efd8822 [PHP_MD5] => [ホーム] => /home/glot [PHP_SELF] => /tmp/543750210/main.php [SCRIPT_NAME] => /tmp/543750210/main.php [SCRIPT_FILENAME] => /tmp/543750210/main.php [PATH_TRANSLATED] => /tmp/543750210/main.php [DOCUMENT_ROOT] => [REQUEST_TIME_FLOAT] => 1524198667.12 [REQUEST_TIME] => 1524198667 [argv] => Array ( [0] => /tmp/543750210/main.php ) [argc] => 1)Array( [0] => _GET [1] => _POST [2] => _COOKIE [3] => _FILES [4] => argv [5] => argc [6] => _SERVER [7] => b [8] => arr)