Is it possible to create a function out of a class method?
ie.
class Test {
public function __construct()
{
if ( ! function_exists('foo') ) {
function foo ()
{
return $this->foo();
}
}
}
private function foo()
{
return 'bar';
}
}
Or would I have to do it the other way around, creating a function and using it within the method?
Just do it like that, php is able to do it