变量作用域变量作用域所有声明的变量都局部作用于声明它们的方法: namespace Test;class MyClass{ public function someMethod1() { int a = 1, b = 2; return a + b; } public function someMethod2() { int a = 3, b = 4; return a + b; }}