diff --git a/lib/Forking/Fork.php b/lib/Forking/Fork.php index ce643e8..9c01551 100644 --- a/lib/Forking/Fork.php +++ b/lib/Forking/Fork.php @@ -205,7 +205,7 @@ class Fork implements Process, Strand { private function execute(Channel $channel): \Generator { try { if ($this->function instanceof \Closure) { - $result = call($this->function->bindTo($channel, Channel::class), ...$this->args); + $result = call($this->function->bindTo($channel, null), ...$this->args); } else { $result = call($this->function, ...$this->args); } diff --git a/lib/Threading/Internal/Thread.php b/lib/Threading/Internal/Thread.php index af9a79e..b6ba833 100644 --- a/lib/Threading/Internal/Thread.php +++ b/lib/Threading/Internal/Thread.php @@ -121,7 +121,7 @@ class Thread extends \Thread { private function execute(Channel $channel): \Generator { try { if ($this->function instanceof \Closure) { - $result = call($this->function->bindTo($channel, Channel::class), ...$this->args); + $result = call($this->function->bindTo($channel, null), ...$this->args); } else { $result = call($this->function, ...$this->args); }