php variable scope

后端 未结 6 2017
栀梦
栀梦 2020-12-01 19:31

i\'m confused about the php variable scope. such as:

while(true){
    $var = \"yes , it is a test!\";
  }
  printf($var)

the $var

6条回答
  •  长情又很酷
    2020-12-01 20:21

    while is not a function. scope of variable refers to variable inside functions and classes

提交回复
热议问题