当前位置:Gxlcms > PHP教程 > php在函数外宣言global变量有什么用

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

时间:2021-07-01 10:21:17 帮助过:35人阅读

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

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

/*
* These can't be directly globalized in version.php. When updating,
* we're including version.php from another install and don't want
* these values to be overridden if already set.
*/
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_mysql_version;
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' );没作用

人气教程排行