Home  >  Article  >  Backend Development  >  php在函数外宣言global变量有什么用

php在函数外宣言global变量有什么用

WBOY
WBOYOriginal
2016-06-13 12:29:43831browse

php在函数外声明global变量有什么用?
php在函数外声明global变量有什么用?

我看wordpress的wp-settings.php文件中有这么一段:

/*<br />
 * These can't be directly globalized in version.php. When updating,<br />
 * we're including version.php from another install and don't want<br />
 * these values to be overridden if already set.<br />
 */<br />
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;<br />
require( ABSPATH . WPINC . '/version.php' );


不懂,求解释,谢谢啦 ^_^没有作用
并且在 wp-settings.php 中也没有看到
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;
只有
require( ABSPATH . WPINC . '/version.php' );没作用

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn