In PHP in order to define a callback a closure can be used and the tool for passing static parameters is the `use` directive.

```
class MyClass {
    public function foo($x) {
        echo $x;
    }
    public function bar() {
        $x = '123';
        $callback = function () use ($x) {
            $this->foo($x);
        };
        $callback();
    }
}

$myClass = new MyClass();
$myClass->bar();

```

Is it possible / How to avoid the anonymous function and replace it by a method?

```
class MyClass {
    public function foo($x) {
        echo $x;
    }
    public function baz() {
        $x = '567';
        // There is no function with the name create_user_func.
        // Just to show, what I'm looking for.
        $callback = create_callback([$this, 'foo'], $params = [$x]);
        $callback();
    }
}

$myClass = new MyClass();
$myClass->baz();

```

---

**EDIT**:

Some additional / backgroud info (to make clear, what I want to achieve and why -- and to avoid misanderstandings):

In my concrete case I need to pass the callback to a method of a framework. That means: I cannot / may not affect the way it gets called.

The method accepts only the callback itself, no arguments for the callback. That means, the callback has to "know"/provide the static parameters (and their values) it needs.

It's exactly, what the `use` directive solves. But I have multiple callback definitions in my method, and the method is getting long. So I want to move the logic of the callbacks to separate methods.