2
Is there any way to do that?
<?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 using call_user_func
, and use this function in a namespace Foo
, to call a function of the namespace Foo
, how can I know that this function is passed on the namespace Foo
?
I translated, is this wrong! I found the question interesting
– Wallace Maxters
@Wallacemaxters is not wrong, feel free to translate
– Math