class Test
{
public $callback = "sqrt";
public function cube($n)
{
return($n * $n * $n);
}
public function cool()
{
$a = array(1, 2, 3, 4, 5);
$b = array_map( $this->callback , $a);
var_dump($b);
}
}
$t = new Test();
$t->cool();
In this code if $callback is set to something like intval or sqrt then it will work fine , but when i try to use cube method as callback function it is giving following error. Why so and how to call method cube from cool method as callback
