Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pangudashu committed Jul 25, 2017
1 parent 163db8b commit 337ab9c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions 2/global_var.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## 2.4 全局变量
PHP中在函数、类之外直接定义的变量可以在函数、类成员方法中通过global关键词引入使用,这些变量称为:全局变量。

这些直接在PHP中定义的变量(包括include、require文件中的)相对于函数、类方法而言它们是全局变量,但是对自身执行域zend_execute_data而言它们是普通的局部变量,自身执行时它们与普通变量的读写方式完全相同。
PHP中把定义在函数、类之外的变量称之为全局变量,也就是定义在主脚本中的变量,这些变量可以在函数、成员方法中通过global关键字引入使用。

```php
function test() {
Expand Down

0 comments on commit 337ab9c

Please sign in to comment.