関数の実行後に関数内の変数は破棄されますか?
class B {
function C() {
$x = "123456";
echo "XXX".$x;
// After this function is finished, will $x be destroyed by default to save memory in PHP?
}
}
class A {
function F1() {
return new Class_B();
}
function F2() {
$this->F1()->C();
// After this function is finished, will F1 be destroyed by default to save memory and CPU in PHP?
}
}