Is there any way to do this?
<?php
namespace Bar {
class test {
public function test($action) {
call_user_func($action); // must call \Foo\Action
}
}
}
namespace Foo {
$test = new \Bar\Test;
function action () {
echo 'it works!';
}
$test->test('action');
}
For a more detailed description: If I have a function that calls user-defined functions with the use of call_user_func
, and use that function in a Foo
namespace, to call a namespace Foo
function like me can I know that this function is passed on namespace Foo
?