프로그래밍/PHP

php variable scope - if statements

암초보 2014. 9. 26. 16:19

If statement blocks do not have their own scope.


즉, 아래 코드는 "Hello..."을 출력할 것이다.


$cond = true;
if($cond) {
      $a = "Hello...";
}
echo $a;