Hi,
why does this code not work properly ?
class arraywalktest
{
var $testarray = array('a','b','c');
var $test;
function arraywalktest()
{
$this->test = 0;
}
function find()
{
array_walk($this->testarray, array($this,"compare"));
echo $this->test;
}
function compare($test)
{
#some code doing something with the array
echo "!";
$this->test = 1;
}
}
$test = new arraywalktest();
$test->find();
the output is !!!0 not !!!1.
Why can't i change $this->test while in function compare() ?
cu,
Hawk