Hello folks,
Does anyone know the correct syntax to call a classes' member function through a member variable? I know how to do this as a pure function as:
<?php
function foo()
{
echo "Hello World!";
}
$call = "foo";
$call(); // This calls foo();
?>
Here's my class implementation:
class foo
{
var $z;
var $ptr;
function foo($arg)
{
$this->z = 0;
$this->ptr = $arg;
}
function foo1
{
$this->ptr(); // How do I call foo2 through the member variable???
// what ever ...
}
function foo2
{
// what ever ...
}
function foo3
{
// what ever ...
}
}
$test = new foo("foo2");
$test->foo1(); // I want foo1() to call foo2()....
Any help would be greatly appreciated!!