When you use:
$this->$key = $value
You are declaring them, that is the declaration statement. For example, say $rs[] is this:
$rs = array("one" => 1, "two" => 2, "three" => 3);
Now, you're taking that array and declaring the keys of the arrays as class variables. After you exectute that last inner for loop, you'll be able to access the following $this->one, $this->two, and $this->three because you declared them as class variables inside the for loop.
I hope that helps, unless I misunderstood what you were asking.