First excuse my english I'm not a native speaker and sorry if it looks rough, this is the first time that I post on this site. My problem is quite simple I think. Let's say, we have :
class A {
function foo() {
function bar ($arg){
echo $this->baz, $arg;
}
bar("world !");
}
protected $baz = "Hello ";
}
$qux = new A;
$qux->foo();
In this example, "$this" obviously doesn't refer to my object "$qux".
How should I do to make it reffer to "$qux"?
As might be in JavaScript : bar.bind(this, "world !")