i'm confused about the php variable scope. such as:
while(true){
$var = "yes , it is a test!";
}
printf($var)
the $var
is defined in while statement scope , how could we get it outside it's scope ? and i can't find explanation on the document .
i wonder how php deal with it's scope .