Can someone please tell me if this method of doing foreach has drawbacks?
class someclass {
function foo() {
foreach ($my_array as $this->key => $this->value) {
$this->bar();
$this->baz();
}
}
function bar(){
//do something with $this->key or $this->value
}
function baz(){
//do something with $this->key or $this->value
}
}