The title may be a bit confusing, so let me explain. I have a class and a method. That that method itself has a function. Like this:
class MyClass {
public static function my_function($param) {
function nested_function() {
//do something with $param
}
}
}
So my question is, how can I access $param in nested_function?
EDIT
The reason I'm doing this is because of a wordpress thing. I need something like this:
class MyClass {
public static function my_function($param) {
function nested_function() {
//do something with $param
}
add_action('init', 'nested_function');
}
}
function nested_function($param) use ($param) { // code here }